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

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

Issue 698623002: Split WarningService from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
index c1887b411e6e019e9ce7152faf71f4b5e6c87a53..70f5ca0a79e65422b2ec2272050aebf2ce354c40 100644
--- a/chrome/browser/extensions/extension_warning_badge_service.h
+++ b/chrome/browser/extensions/extension_warning_badge_service.h
@@ -7,6 +7,7 @@
#include "base/compiler_specific.h"
#include "base/threading/non_thread_safe.h"
+#include "components/keyed_service/core/keyed_service.h"
#include "extensions/browser/warning_service.h"
#include "extensions/browser/warning_set.h"
@@ -18,12 +19,15 @@ namespace extensions {
// A service that is responsible for showing an extension warning badge on the
// wrench menu.
-class ExtensionWarningBadgeService : public WarningService::Observer,
+class ExtensionWarningBadgeService : public KeyedService,
+ public WarningService::Observer,
public base::NonThreadSafe {
public:
explicit ExtensionWarningBadgeService(Profile* profile);
virtual ~ExtensionWarningBadgeService();
+ static ExtensionWarningBadgeService* Get(content::BrowserContext* context);
+
// 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();
@@ -41,6 +45,9 @@ class ExtensionWarningBadgeService : public WarningService::Observer,
Profile* profile_;
+ ScopedObserver<WarningService, WarningService::Observer>
+ warning_service_observer_;
+
// Warnings that do not trigger a badge on the wrench menu.
WarningSet suppressed_warnings_;

Powered by Google App Engine
This is Rietveld 408576698