| 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();
|
|
|