Chromium Code Reviews| Index: chrome/browser/ui/app_list/extension_app_model_builder.cc |
| diff --git a/chrome/browser/ui/app_list/extension_app_model_builder.cc b/chrome/browser/ui/app_list/extension_app_model_builder.cc |
| index fdf191cc2126a305335d34c6273ab2ff1d51b1e3..dfeadff10ae41dcc151963019189043dc7d07c52 100644 |
| --- a/chrome/browser/ui/app_list/extension_app_model_builder.cc |
| +++ b/chrome/browser/ui/app_list/extension_app_model_builder.cc |
| @@ -22,6 +22,7 @@ |
| #include "chrome/common/chrome_switches.h" |
| #include "content/public/browser/notification_service.h" |
| #include "extensions/browser/extension_prefs.h" |
| +#include "extensions/browser/extension_registry.h" |
| #include "extensions/browser/extension_system.h" |
| #include "extensions/browser/extensions_browser_client.h" |
| #include "extensions/browser/pref_names.h" |
| @@ -38,7 +39,8 @@ ExtensionAppModelBuilder::ExtensionAppModelBuilder( |
| controller_(controller), |
| model_(NULL), |
| highlighted_app_pending_(false), |
| - tracker_(NULL) { |
| + tracker_(NULL), |
| + extension_registry_observer_(this) { |
| } |
| ExtensionAppModelBuilder::~ExtensionAppModelBuilder() { |
| @@ -124,7 +126,31 @@ void ExtensionAppModelBuilder::OnInstallFailure( |
| model_->DeleteItem(extension_id); |
| } |
| -void ExtensionAppModelBuilder::OnExtensionLoaded(const Extension* extension) { |
| +void ExtensionAppModelBuilder::OnDisabledExtensionUpdated( |
| + const Extension* extension) { |
| + if (!extensions::ui_util::ShouldDisplayInAppLauncher(extension, profile_)) |
| + return; |
| + |
| + ExtensionAppItem* existing_item = GetExtensionAppItem(extension->id()); |
| + if (existing_item) |
| + existing_item->Reload(); |
|
not at google - send to devlin
2014/05/29 18:09:29
ugh annoying diff. but it looks right.
limasdf
2014/05/30 21:00:49
rearranged :)
|
| +} |
| + |
| +void ExtensionAppModelBuilder::OnAppInstalledToAppList( |
| + const std::string& extension_id) { |
| + SetHighlightedApp(extension_id); |
| +} |
| + |
| +void ExtensionAppModelBuilder::OnShutdown() { |
| + if (tracker_) { |
| + tracker_->RemoveObserver(this); |
| + tracker_ = NULL; |
| + } |
| +} |
| + |
| +void ExtensionAppModelBuilder::OnExtensionLoaded( |
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension) { |
| if (!extensions::ui_util::ShouldDisplayInAppLauncher(extension, profile_)) |
| return; |
| @@ -145,7 +171,10 @@ void ExtensionAppModelBuilder::OnExtensionLoaded(const Extension* extension) { |
| UpdateHighlight(); |
| } |
| -void ExtensionAppModelBuilder::OnExtensionUnloaded(const Extension* extension) { |
| +void ExtensionAppModelBuilder::OnExtensionUnloaded( |
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension, |
| + extensions::UnloadedExtensionInfo::Reason reason) { |
| ExtensionAppItem* item = GetExtensionAppItem(extension->id()); |
| if (!item) |
| return; |
| @@ -153,7 +182,8 @@ void ExtensionAppModelBuilder::OnExtensionUnloaded(const Extension* extension) { |
| } |
| void ExtensionAppModelBuilder::OnExtensionUninstalled( |
| - const Extension* extension) { |
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension) { |
| if (service_) { |
| DVLOG(2) << service_ << ": OnExtensionUninstalled: " |
| << extension->id().substr(0, 8); |
| @@ -163,28 +193,6 @@ void ExtensionAppModelBuilder::OnExtensionUninstalled( |
| model_->DeleteItem(extension->id()); |
| } |
| -void ExtensionAppModelBuilder::OnDisabledExtensionUpdated( |
| - const Extension* extension) { |
| - if (!extensions::ui_util::ShouldDisplayInAppLauncher(extension, profile_)) |
| - return; |
| - |
| - ExtensionAppItem* existing_item = GetExtensionAppItem(extension->id()); |
| - if (existing_item) |
| - existing_item->Reload(); |
| -} |
| - |
| -void ExtensionAppModelBuilder::OnAppInstalledToAppList( |
| - const std::string& extension_id) { |
| - SetHighlightedApp(extension_id); |
| -} |
| - |
| -void ExtensionAppModelBuilder::OnShutdown() { |
| - if (tracker_) { |
| - tracker_->RemoveObserver(this); |
| - tracker_ = NULL; |
| - } |
| -} |
| - |
| scoped_ptr<ExtensionAppItem> ExtensionAppModelBuilder::CreateAppItem( |
| const std::string& extension_id, |
| const std::string& extension_name, |