Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: chrome/browser/extensions/extension_warning_badge_service.h

Issue 10407105: Improve error messaging of webRequest API in case of conflicts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Evan's comments Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_warning_badge_service.h
diff --git a/chrome/browser/extensions/extension_warning_badge_service.h b/chrome/browser/extensions/extension_warning_badge_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..461bc5c6bf931b4a4f2f1e8ca593cfa3dac411a6
--- /dev/null
+++ b/chrome/browser/extensions/extension_warning_badge_service.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_BADGE_SERVICE_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_BADGE_SERVICE_H_
+
+#include "base/compiler_specific.h"
+#include "base/threading/non_thread_safe.h"
+#include "chrome/browser/extensions/extension_warning_service.h"
+#include "chrome/browser/extensions/extension_warning_set.h"
+
+// TODO(battre): Rename ExtensionWarningBadgeService to WarningBadgeService.
+
+class Profile;
+
+namespace extensions {
+
+// A service that is responsible for showing an extension warning badge on the
+// wrench menu.
+class ExtensionWarningBadgeService : public ExtensionWarningService::Observer,
+ public base::NonThreadSafe {
+ public:
+ explicit ExtensionWarningBadgeService(Profile* profile);
+ virtual ~ExtensionWarningBadgeService();
+
+ // Black lists all currently active extension warnings, so that they do not
+ // trigger a warning badge again for the life-time of the browsing session.
+ void SuppressCurrentWarnings();
+
+ protected:
+ // Virtual for testing.
+ virtual const std::set<ExtensionWarning>& GetCurrentWarnings() const;
+
+ private:
+ // Implementation of ExtensionWarningService::Observer.
+ virtual void ExtensionWarningsChanged() OVERRIDE;
+
+ void UpdateBadgeStatus();
+ virtual void ShowBadge(bool show);
+
+ Profile* profile_;
+
+ // Warnings that do not trigger a badge on the wrench menu.
+ ExtensionWarningSet suppressed_warnings_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionWarningBadgeService);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_BADGE_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698