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

Unified Diff: chrome/browser/ui/extensions/extension_enable_flow.cc

Issue 251603004: Remove NOTIFICATION_EXTENSION_LOADED_DEPRECATED from c/b/ui/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review 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/ui/extensions/extension_enable_flow.cc
diff --git a/chrome/browser/ui/extensions/extension_enable_flow.cc b/chrome/browser/ui/extensions/extension_enable_flow.cc
index 3b6c1a960f41f2950dc3d8fcfa5de4940f3aa3c3..5d41cf8b99833c82255e7698f3f8485da1670ee9 100644
--- a/chrome/browser/ui/extensions/extension_enable_flow.cc
+++ b/chrome/browser/ui/extensions/extension_enable_flow.cc
@@ -24,7 +24,8 @@ ExtensionEnableFlow::ExtensionEnableFlow(Profile* profile,
extension_id_(extension_id),
delegate_(delegate),
parent_contents_(NULL),
- parent_window_(NULL) {
+ parent_window_(NULL),
+ extension_registry_observer_(this) {
}
ExtensionEnableFlow::~ExtensionEnableFlow() {
@@ -110,9 +111,8 @@ void ExtensionEnableFlow::CreatePrompt() {
}
void ExtensionEnableFlow::StartObserving() {
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
- content::Source<Profile>(profile_));
+ extension_registry_observer_.Add(
+ extensions::ExtensionRegistry::Get(profile_));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOAD_ERROR,
content::Source<Profile>(profile_));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
@@ -127,16 +127,6 @@ void ExtensionEnableFlow::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
- const Extension* extension =
- content::Details<const Extension>(details).ptr();
- if (extension->id() == extension_id_) {
- StopObserving();
- CheckPermissionAndMaybePromptUser();
- }
-
- break;
- }
case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: {
StopObserving();
delegate_->ExtensionEnableFlowAborted(false);
@@ -149,7 +139,6 @@ void ExtensionEnableFlow::Observe(int type,
StopObserving();
delegate_->ExtensionEnableFlowAborted(false);
}
-
break;
}
default:
@@ -157,6 +146,15 @@ void ExtensionEnableFlow::Observe(int type,
}
}
+void ExtensionEnableFlow::OnExtensionLoaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension) {
+ if (extension->id() == extension_id_) {
+ StopObserving();
+ CheckPermissionAndMaybePromptUser();
+ }
+}
+
void ExtensionEnableFlow::InstallUIProceed() {
ExtensionService* service =
extensions::ExtensionSystem::Get(profile_)->extension_service();
« no previous file with comments | « chrome/browser/ui/extensions/extension_enable_flow.h ('k') | chrome/browser/ui/extensions/extension_installed_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698