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

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

Issue 271393003: Use ExtensionRegistryObserver instead of deprecated extension notification from autocomplete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: colon to period Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/extension_app_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/extension_app_provider.h
diff --git a/chrome/browser/autocomplete/extension_app_provider.h b/chrome/browser/autocomplete/extension_app_provider.h
index 5dbcc2638bb9259664955149f35bbe8642d5b234..6494551d876a0385fb89a1f7e50d3e734fdbd4bf 100644
--- a/chrome/browser/autocomplete/extension_app_provider.h
+++ b/chrome/browser/autocomplete/extension_app_provider.h
@@ -10,18 +10,25 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
+#include "base/scoped_observer.h"
#include "chrome/browser/autocomplete/autocomplete_input.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/autocomplete/autocomplete_provider.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
#include "ui/base/window_open_disposition.h"
+namespace extensions {
+class ExtensionRegistry;
+}
+
// This provider is responsible for keeping track of which Extension Apps are
// installed and their URLs. An instance of it gets created and managed by
// AutocompleteController.
class ExtensionAppProvider : public AutocompleteProvider,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public extensions::ExtensionRegistryObserver {
public:
ExtensionAppProvider(AutocompleteProviderListener* listener,
Profile* profile);
@@ -81,8 +88,17 @@ class ExtensionAppProvider : public AutocompleteProvider,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // extensions::ExtensionRegistryObserver implementation:
+ virtual void OnExtensionLoaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension) OVERRIDE;
+
content::NotificationRegistrar registrar_;
+ ScopedObserver<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ extension_registry_observer_;
+
// Our cache of ExtensionApp objects (name + url) representing the extension
// apps we know/care about.
ExtensionApps extension_apps_;
« no previous file with comments | « no previous file | chrome/browser/autocomplete/extension_app_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698