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

Unified Diff: chrome/browser/extensions/webstore_installer.h

Issue 279073003: Add a function triggering extension installed to ExtensionRegistryObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add more DCHECK and test code Created 6 years, 7 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
« no previous file with comments | « chrome/browser/extensions/install_tracker.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/webstore_installer.h
diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h
index c0e2d50fc7461b046328faffdc978794d2779ceb..c2d1646888f37c69fdb7db086904c3d96582b911 100644
--- a/chrome/browser/extensions/webstore_installer.h
+++ b/chrome/browser/extensions/webstore_installer.h
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/scoped_observer.h"
#include "base/supports_user_data.h"
#include "base/timer/timer.h"
#include "base/values.h"
@@ -22,6 +23,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
+#include "extensions/browser/extension_registry_observer.h"
#include "extensions/common/manifest_handlers/shared_module_info.h"
#include "ui/gfx/image/image_skia.h"
#include "url/gurl.h"
@@ -40,14 +42,17 @@ namespace extensions {
class CrxInstaller;
class Extension;
+class ExtensionRegistry;
class Manifest;
// Downloads and installs extensions from the web store.
class WebstoreInstaller : public content::NotificationObserver,
+ public ExtensionRegistryObserver,
public content::DownloadItem::Observer,
public content::WebContentsObserver,
public base::RefCountedThreadSafe<
- WebstoreInstaller, content::BrowserThread::DeleteOnUIThread> {
+ WebstoreInstaller,
+ content::BrowserThread::DeleteOnUIThread> {
public:
enum InstallSource {
// Inline installs trigger slightly different behavior (install source
@@ -188,11 +193,18 @@ class WebstoreInstaller : public content::NotificationObserver,
// Starts downloading and installing the extension.
void Start();
- // content::NotificationObserver
+ // content::NotificationObserver.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // ExtensionRegistryObserver.
+ virtual void OnExtensionWillBeInstalled(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ bool is_update,
+ const std::string& old_name) OVERRIDE;
+
// Removes the reference to the delegate passed in the constructor. Used when
// the delegate object must be deleted before this object.
void InvalidateDelegate();
@@ -249,6 +261,8 @@ class WebstoreInstaller : public content::NotificationObserver,
void RecordInterrupt(const content::DownloadItem* download) const;
content::NotificationRegistrar registrar_;
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
+ extension_registry_observer_;
Profile* profile_;
Delegate* delegate_;
std::string id_;
« no previous file with comments | « chrome/browser/extensions/install_tracker.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698