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

Unified Diff: chrome/browser/ui/app_list/search/webstore/webstore_result.h

Issue 323763002: Remove InstallTracker's extension installed, uninstalled observers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix clang error Created 6 years, 6 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
Index: chrome/browser/ui/app_list/search/webstore/webstore_result.h
diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_result.h b/chrome/browser/ui/app_list/search/webstore/webstore_result.h
index c9af4cc21a371118f9f974c215e3021153ab21a2..9160f0f7de048e2dd0786e78bdee7b1e062f110b 100644
--- a/chrome/browser/ui/app_list/search/webstore/webstore_result.h
+++ b/chrome/browser/ui/app_list/search/webstore/webstore_result.h
@@ -11,19 +11,22 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/install_observer.h"
#include "chrome/browser/ui/app_list/search/chrome_search_result.h"
+#include "extensions/browser/extension_registry_observer.h"
#include "url/gurl.h"
class AppListControllerDelegate;
class Profile;
namespace extensions {
+class ExtensionRegistry;
class InstallTracker;
}
namespace app_list {
class WebstoreResult : public ChromeSearchResult,
- public extensions::InstallObserver {
+ public extensions::InstallObserver,
+ public extensions::ExtensionRegistryObserver {
public:
WebstoreResult(Profile* profile,
const std::string& app_id,
@@ -46,16 +49,26 @@ class WebstoreResult : public ChromeSearchResult,
void StartInstall(bool launch_ephemeral_app);
void InstallCallback(bool success, const std::string& error);
- void StartObservingInstall();
+ // Start observing both InstallObserver and ExtensionRegistryObserver.
+ void StartObserving();
+
void StopObservingInstall();
+ void StopObservingRegistry();
// extensions::InstallObserver overrides:
virtual void OnDownloadProgress(const std::string& extension_id,
int percent_downloaded) OVERRIDE;
- virtual void OnExtensionInstalled(
- const extensions::Extension* extension) OVERRIDE;
virtual void OnShutdown() OVERRIDE;
+ // extensions::ExtensionRegistryObserver overides:
+ virtual void OnExtensionWillBeInstalled(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ bool is_update,
+ bool from_ephemeral,
+ const std::string& old_name) OVERRIDE;
+ virtual void OnShutdown(extensions::ExtensionRegistry* registry) OVERRIDE;
+
Profile* profile_;
const std::string app_id_;
const std::string localized_name_;
@@ -66,6 +79,7 @@ class WebstoreResult : public ChromeSearchResult,
AppListControllerDelegate* controller_;
extensions::InstallTracker* install_tracker_; // Not owned.
+ extensions::ExtensionRegistry* extension_registry_; // Not owned.
DISALLOW_COPY_AND_ASSIGN(WebstoreResult);
};

Powered by Google App Engine
This is Rietveld 408576698