diff options
author | reillyg <reillyg@chromium.org> | 2014-11-03 08:47:57 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-03 16:48:19 +0000 |
commit | 22114a38f8e580253332a3fbef0a1892aee1e982 (patch) | |
tree | 0dae8818ab95beaf6da8e65b3cf1d56035cca9f3 /extensions/browser/warning_service.h | |
parent | 382af4619960b659a5ac7952dcc04e20ebaf4fe4 (diff) | |
download | chromium_src-22114a38f8e580253332a3fbef0a1892aee1e982.zip chromium_src-22114a38f8e580253332a3fbef0a1892aee1e982.tar.gz chromium_src-22114a38f8e580253332a3fbef0a1892aee1e982.tar.bz2 |
Split WarningService from ExtensionSystem.
This patch removes both the WarningService accessors from
ExtensionSystem and also the ExtensionWarningBadgeService instance
that it created as this can be built automatically for every
BrowserContext simply by declaring so in its new factory.
BUG=
Review URL: https://codereview.chromium.org/698623002
Cr-Commit-Position: refs/heads/master@{#302438}
Diffstat (limited to 'extensions/browser/warning_service.h')
-rw-r--r-- | extensions/browser/warning_service.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/extensions/browser/warning_service.h b/extensions/browser/warning_service.h index 283bf6d..5aa9a50 100644 --- a/extensions/browser/warning_service.h +++ b/extensions/browser/warning_service.h @@ -12,6 +12,7 @@ #include "base/observer_list.h" #include "base/scoped_observer.h" #include "base/threading/non_thread_safe.h" +#include "components/keyed_service/core/keyed_service.h" #include "extensions/browser/extension_registry_observer.h" #include "extensions/browser/warning_set.h" @@ -31,7 +32,8 @@ class ExtensionRegistry; // conflicting modifications of network requests by extensions, slow extensions, // etc.) trigger a warning badge in the UI and and provide means to resolve // them. This class must be used on the UI thread only. -class WarningService : public ExtensionRegistryObserver, +class WarningService : public KeyedService, + public ExtensionRegistryObserver, public base::NonThreadSafe { public: class Observer { @@ -44,6 +46,10 @@ class WarningService : public ExtensionRegistryObserver, explicit WarningService(content::BrowserContext* browser_context); ~WarningService() override; + // Get the instance of the WarningService for |browser_context|. + // Redirected in incognito. + static WarningService* Get(content::BrowserContext* browser_context); + // Clears all warnings of types contained in |types| and notifies observers // of the changed warnings. void ClearWarnings(const std::set<Warning::WarningType>& types); |