Index: chrome/browser/ui/webui/app_list/start_page_handler.cc |
diff --git a/chrome/browser/ui/webui/app_list/start_page_handler.cc b/chrome/browser/ui/webui/app_list/start_page_handler.cc |
index 604797357880b2729621a8b9ab7a29347ec499ac..a3b489ca04cc5aaa31af24553a0be2691b0b1394 100644 |
--- a/chrome/browser/ui/webui/app_list/start_page_handler.cc |
+++ b/chrome/browser/ui/webui/app_list/start_page_handler.cc |
@@ -9,7 +9,6 @@ |
#include "base/bind.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/values.h" |
-#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/omaha_query_params/omaha_query_params.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -21,9 +20,8 @@ |
#include "chrome/browser/ui/host_desktop.h" |
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
#include "chrome/common/pref_names.h" |
-#include "content/public/browser/notification_details.h" |
-#include "content/public/browser/notification_source.h" |
#include "content/public/browser/web_ui.h" |
+#include "extensions/browser/extension_registry.h" |
#include "extensions/browser/extension_system.h" |
#include "extensions/common/extension.h" |
#include "extensions/common/extension_icon_set.h" |
@@ -61,7 +59,9 @@ scoped_ptr<base::DictionaryValue> CreateAppInfo( |
} // namespace |
-StartPageHandler::StartPageHandler() : recommended_apps_(NULL) {} |
+StartPageHandler::StartPageHandler() |
+ : recommended_apps_(NULL), extension_registry_observer_(this) { |
+} |
StartPageHandler::~StartPageHandler() { |
if (recommended_apps_) |
@@ -89,31 +89,26 @@ void StartPageHandler::RegisterMessages() { |
base::Unretained(this))); |
} |
-void StartPageHandler::Observe(int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) { |
+void StartPageHandler::OnExtensionLoaded( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension) { |
#if defined(OS_CHROMEOS) |
DCHECK_EQ(Profile::FromWebUI(web_ui()), |
content::Source<Profile>(source).ptr()); |
Devlin
2014/05/16 17:34:04
This won't compile - the |source| variable is gone
|
- switch (type) { |
- case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: { |
- extensions::Extension* extension = |
- content::Details<extensions::Extension>(details).ptr(); |
- if (extension->id() == extension_misc::kHotwordExtensionId) |
- OnHotwordEnabledChanged(); |
- break; |
- } |
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: { |
- extensions::UnloadedExtensionInfo* info = |
- content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); |
- if (info->extension->id() == extension_misc::kHotwordExtensionId) |
- OnHotwordEnabledChanged(); |
- break; |
- } |
- default: |
- NOTREACHED(); |
- break; |
- } |
+ if (extension->id() == extension_misc::kHotwordExtensionId) |
+ OnHotwordEnabledChanged(); |
+#endif |
+} |
+ |
+void StartPageHandler::OnExtensionUnloaded( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension, |
+ extensions::UnloadedExtensionInfo::Reason reason) { |
+#if defined(OS_CHROMEOS) |
+ DCHECK_EQ(Profile::FromWebUI(web_ui()), |
Devlin
2014/05/16 17:34:04
same as above.
|
+ content::Source<Profile>(source).ptr()); |
+ if (extension->id() == extension_misc::kHotwordExtensionId) |
+ OnHotwordEnabledChanged(); |
#endif |
} |
@@ -177,11 +172,9 @@ void StartPageHandler::HandleInitialize(const base::ListValue* args) { |
prefs::kHotwordSearchEnabled, |
base::Bind(&StartPageHandler::OnHotwordEnabledChanged, |
base::Unretained(this))); |
- registrar_.Add(this, |
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
- content::Source<Profile>(profile)); |
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
- content::Source<Profile>(profile)); |
+ |
+ extension_registry_observer_.Add( |
+ extensions::ExtensionRegistry::Get(profile)); |
} |
#endif |