Index: chrome/browser/autocomplete/extension_app_provider.cc |
diff --git a/chrome/browser/autocomplete/extension_app_provider.cc b/chrome/browser/autocomplete/extension_app_provider.cc |
index f29b991841390e2b58a5dd148d688a9b75686a47..c53802b3b7ec125d4242bb7e907d09e76472b3be 100644 |
--- a/chrome/browser/autocomplete/extension_app_provider.cc |
+++ b/chrome/browser/autocomplete/extension_app_provider.cc |
@@ -29,16 +29,20 @@ |
ExtensionAppProvider::ExtensionAppProvider( |
AutocompleteProviderListener* listener, |
Profile* profile) |
- : AutocompleteProvider(listener, profile, |
- AutocompleteProvider::TYPE_EXTENSION_APP) { |
+ : AutocompleteProvider(listener, |
+ profile, |
+ AutocompleteProvider::TYPE_EXTENSION_APP), |
+ extension_registry_observer_(this) { |
// Notifications of extensions loading and unloading always come from the |
// non-incognito profile, but we need to see them regardless, as the incognito |
// windows can be affected. |
- registrar_.Add(this, |
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
- content::Source<Profile>(profile_->GetOriginalProfile())); |
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
content::Source<Profile>(profile_->GetOriginalProfile())); |
+ |
+ // ExtensionRegistryObserver handles use non-incognito profile itself. |
Peter Kasting
2014/05/12 19:46:55
Is this comment trying to say "ExtensionRegistryOb
limasdf
2014/05/13 14:38:44
Yes, Exactly. I blame my English T.T
Updated.
|
+ extension_registry_observer_.Add( |
+ extensions::ExtensionRegistry::Get(profile_)); |
+ |
RefreshAppList(); |
} |
@@ -183,9 +187,16 @@ void ExtensionAppProvider::RefreshAppList() { |
} |
} |
+void ExtensionAppProvider::OnExtensionLoaded( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension) { |
+ RefreshAppList(); |
+} |
+ |
void ExtensionAppProvider::Observe(int type, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) { |
+ DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_UNINSTALLED); |
Peter Kasting
2014/05/12 19:46:55
Nit: (expected, actual)
limasdf
2014/05/13 14:38:44
Done.
|
RefreshAppList(); |
} |