Index: chrome/browser/ui/app_list/search/app_result.cc |
diff --git a/chrome/browser/ui/app_list/search/app_result.cc b/chrome/browser/ui/app_list/search/app_result.cc |
index 2375213f3193746bc0fa347cd1a525e40fb86db8..20af729597ad1108917b0d08ecf8df31ddb1c992 100644 |
--- a/chrome/browser/ui/app_list/search/app_result.cc |
+++ b/chrome/browser/ui/app_list/search/app_result.cc |
@@ -6,8 +6,6 @@ |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/extensions/extension_util.h" |
-#include "chrome/browser/extensions/install_tracker.h" |
-#include "chrome/browser/extensions/install_tracker_factory.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/app_list/app_context_menu.h" |
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
@@ -16,6 +14,7 @@ |
#include "chrome/browser/ui/extensions/extension_enable_flow.h" |
#include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" |
#include "content/public/browser/user_metrics.h" |
+#include "extensions/browser/extension_registry.h" |
#include "extensions/browser/extension_system.h" |
#include "extensions/browser/extension_system_provider.h" |
#include "extensions/browser/extensions_browser_client.h" |
@@ -34,7 +33,7 @@ AppResult::AppResult(Profile* profile, |
: profile_(profile), |
app_id_(app_id), |
controller_(controller), |
- install_tracker_(NULL) { |
+ extension_registry_observer_(this) { |
set_id(extensions::Extension::GetBaseURLFromExtensionId(app_id_).spec()); |
const extensions::Extension* extension = |
@@ -52,11 +51,11 @@ AppResult::AppResult(Profile* profile, |
extensions::util::GetDefaultAppIcon(), |
this)); |
UpdateIcon(); |
- StartObservingInstall(); |
+ |
+ extension_registry_observer_.Add(extensions::ExtensionRegistry::Get(profile)); |
} |
AppResult::~AppResult() { |
- StopObservingInstall(); |
} |
void AppResult::UpdateFromMatch(const TokenizedString& title, |
@@ -121,20 +120,6 @@ ui::MenuModel* AppResult::GetContextMenuModel() { |
return context_menu_->GetMenuModel(); |
} |
-void AppResult::StartObservingInstall() { |
- DCHECK(!install_tracker_); |
- |
- install_tracker_ = extensions::InstallTrackerFactory::GetForProfile(profile_); |
- install_tracker_->AddObserver(this); |
-} |
- |
-void AppResult::StopObservingInstall() { |
- if (install_tracker_) |
- install_tracker_->RemoveObserver(this); |
- |
- install_tracker_ = NULL; |
-} |
- |
bool AppResult::RunExtensionEnableFlow() { |
if (extensions::util::IsAppLaunchableWithoutEnabling(app_id_, profile_)) |
return false; |
@@ -183,17 +168,17 @@ void AppResult::ExtensionEnableFlowAborted(bool user_initiated) { |
controller_->OnCloseChildDialog(); |
} |
-void AppResult::OnExtensionLoaded(const extensions::Extension* extension) { |
+void AppResult::OnExtensionLoaded(content::BrowserContext* browser_context, |
+ const extensions::Extension* extension) { |
UpdateIcon(); |
} |
-void AppResult::OnExtensionUninstalled(const extensions::Extension* extension) { |
+void AppResult::OnExtensionUninstalled(content::BrowserContext* browser_context, |
+ const extensions::Extension* extension) { |
if (extension->id() != app_id_) |
return; |
NotifyItemUninstalled(); |
} |
-void AppResult::OnShutdown() { StopObservingInstall(); } |
not at google - send to devlin
2014/05/29 18:09:29
hm, I'm a bit worried about losing this; the regis
limasdf
2014/05/30 21:00:49
Done.
I added only AppResult. perhaps I have to re
|
- |
} // namespace app_list |