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

Unified Diff: chrome/browser/autocomplete/shortcuts_extensions_manager.h

Issue 2787713002: Remove deprecated extension notification from shortcuts_extensions_manager.h/cc (Closed)
Patch Set: move to enable_extensions Created 3 years, 9 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/autocomplete/shortcuts_extensions_manager.h
diff --git a/chrome/browser/autocomplete/shortcuts_extensions_manager.h b/chrome/browser/autocomplete/shortcuts_extensions_manager.h
index 13e645b6f2e79cf8a66fe4a47824d26e0dcfe8dd..2c9b5041faca65b4ccbc59de69a1d1b543fd9f0a 100644
--- a/chrome/browser/autocomplete/shortcuts_extensions_manager.h
+++ b/chrome/browser/autocomplete/shortcuts_extensions_manager.h
@@ -6,28 +6,42 @@
#define CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_EXTENSIONS_MANAGER_H_
#include "base/macros.h"
+#include "base/scoped_observer.h"
#include "base/supports_user_data.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
+
+#if !BUILDFLAG(ENABLE_EXTENSIONS)
Peter Kasting 2017/03/30 23:35:31 Nit: I'd omit this as I'm not sure it buys much?
limasdf 2017/03/31 03:26:27 Done.
+#error "Should not be included when extensions are disabled"
+#endif
class Profile;
+namespace extensions {
+class ExtensionRegistry;
+}
+
// This class manages the removal of shortcuts associated with an extension when
// that extension is unloaded.
-class ShortcutsExtensionsManager : public base::SupportsUserData::Data,
- public content::NotificationObserver {
+class ShortcutsExtensionsManager
+ : public base::SupportsUserData::Data,
+ public extensions::ExtensionRegistryObserver {
public:
explicit ShortcutsExtensionsManager(Profile* profile);
~ShortcutsExtensionsManager() override;
+ // extensions::ExtensionRegistryObserver:
+ void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionInfo::Reason reason) override;
+ void OnShutdown(extensions::ExtensionRegistry* registry) override;
+
private:
- // content::NotificationObserver:
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ ScopedObserver<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ registry_observer_;
Peter Kasting 2017/03/30 23:35:31 Nit: Blank line optional
limasdf 2017/03/31 03:26:27 Done.
Profile* profile_;
- content::NotificationRegistrar notification_registrar_;
DISALLOW_COPY_AND_ASSIGN(ShortcutsExtensionsManager);
};

Powered by Google App Engine
This is Rietveld 408576698