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

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: 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
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..01ab19415f7d160c9aba38b3b4e2635f1e8c746a 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,16 @@ 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 OnExtensionInstalled(content::BrowserContext* browser_context,
+ const Extension* extension,
+ InstalledExtensionInfo info) 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 +259,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_;

Powered by Google App Engine
This is Rietveld 408576698