diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 19:17:16 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 19:17:16 +0000 |
commit | e1b26bbc7dcc89cded8098e3cc18f03b1299580a (patch) | |
tree | 9ceb9067dcc4899f19a794105e3eb8d195e4f83f /chrome/browser | |
parent | 5c97a7be481d7e4b2f457defc82ea4964c90b553 (diff) | |
download | chromium_src-e1b26bbc7dcc89cded8098e3cc18f03b1299580a.zip chromium_src-e1b26bbc7dcc89cded8098e3cc18f03b1299580a.tar.gz chromium_src-e1b26bbc7dcc89cded8098e3cc18f03b1299580a.tar.bz2 |
Revert 87637 - Show the install dialog for the initial load of an unpacked extension with plugins.
BUG=83273
TEST=in the extensions managmenet page, with developer mode enabled, Load an unpacked extension on an extension with NPAPI plugins. You should get an install dialog.
Review URL: http://codereview.chromium.org/7077018
TBR=mpcomplete@chromium.org
Review URL: http://codereview.chromium.org/7109014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/extensions/extension_service.cc | 70 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_service.h | 5 |
2 files changed, 5 insertions, 70 deletions
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 203e589..c2fe95e 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -35,7 +35,6 @@ #include "chrome/browser/extensions/extension_error_reporter.h" #include "chrome/browser/extensions/extension_history_api.h" #include "chrome/browser/extensions/extension_host.h" -#include "chrome/browser/extensions/extension_install_ui.h" #include "chrome/browser/extensions/extension_management_api.h" #include "chrome/browser/extensions/extension_preference_api.h" #include "chrome/browser/extensions/extension_process_manager.h" @@ -142,52 +141,6 @@ static void ForceShutdownPlugin(const FilePath& plugin_path) { plugin->ForceShutdown(); } -// Manages an ExtensionInstallUI for a particular extension. -class SimpleExtensionLoadPrompt : public ExtensionInstallUI::Delegate { - public: - SimpleExtensionLoadPrompt(Profile* profile, - base::WeakPtr<ExtensionService> extension_service, - const Extension* extension); - ~SimpleExtensionLoadPrompt(); - - void ShowPrompt(); - - // ExtensionInstallUI::Delegate - virtual void InstallUIProceed(); - virtual void InstallUIAbort(); - - private: - base::WeakPtr<ExtensionService> extension_service_; - scoped_ptr<ExtensionInstallUI> install_ui_; - scoped_refptr<const Extension> extension_; -}; - -SimpleExtensionLoadPrompt::SimpleExtensionLoadPrompt( - Profile* profile, - base::WeakPtr<ExtensionService> extension_service, - const Extension* extension) - : extension_service_(extension_service), - install_ui_(new ExtensionInstallUI(profile)), - extension_(extension) { -} - -SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { -} - -void SimpleExtensionLoadPrompt::ShowPrompt() { - install_ui_->ConfirmInstall(this, extension_); -} - -void SimpleExtensionLoadPrompt::InstallUIProceed() { - if (extension_service_.get()) - extension_service_->OnExtensionInstalled(extension_); - delete this; -} - -void SimpleExtensionLoadPrompt::InstallUIAbort() { - delete this; -} - } // namespace ExtensionService::ExtensionRuntimeData::ExtensionRuntimeData() @@ -237,7 +190,7 @@ class ExtensionServiceBackend const std::string& error); // Notify the frontend that an extension was installed. - void OnLoadSingleExtension(const scoped_refptr<const Extension>& extension); + void OnExtensionInstalled(const scoped_refptr<const Extension>& extension); base::WeakPtr<ExtensionService> frontend_; @@ -294,7 +247,7 @@ void ExtensionServiceBackend::LoadSingleExtension(const FilePath& path_in) { BrowserThread::UI, FROM_HERE, NewRunnableMethod( this, - &ExtensionServiceBackend::OnLoadSingleExtension, + &ExtensionServiceBackend::OnExtensionInstalled, extension))) NOTREACHED(); } @@ -308,11 +261,11 @@ void ExtensionServiceBackend::ReportExtensionLoadError( true /* alert_on_error */); } -void ExtensionServiceBackend::OnLoadSingleExtension( +void ExtensionServiceBackend::OnExtensionInstalled( const scoped_refptr<const Extension>& extension) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (frontend_.get()) - frontend_->OnLoadSingleExtension(extension); + frontend_->OnExtensionInstalled(extension); } void ExtensionService::CheckExternalUninstall(const std::string& id) { @@ -1907,21 +1860,6 @@ void ExtensionService::UpdateActiveExtensionsInCrashReporter() { child_process_logging::SetActiveExtensions(extension_ids); } -void ExtensionService::OnLoadSingleExtension(const Extension* extension) { - // If this is a new install of an extension with plugins, prompt the user - // first. - if (!extension->plugins().empty() && - disabled_extension_paths_.find(extension->id()) == - disabled_extension_paths_.end()) { - SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( - profile_, weak_ptr_factory_.GetWeakPtr(), extension); - prompt->ShowPrompt(); - return; // continues in SimpleExtensionLoadPrompt::InstallUI* - } - - OnExtensionInstalled(extension); -} - void ExtensionService::OnExtensionInstalled(const Extension* extension) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index 3bed716..7367255 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -379,9 +379,6 @@ class ExtensionService // been loaded from a file and installed. void AddExtension(const Extension* extension); - // Called by the backend when an unpacked extension has been loaded. - void OnLoadSingleExtension(const Extension* extension); - // Called by the backend when an extension has been installed. void OnExtensionInstalled(const Extension* extension); @@ -653,7 +650,7 @@ class ExtensionService ExtensionToolbarModel toolbar_model_; // Map unloaded extensions' ids to their paths. When a temporarily loaded - // extension is unloaded, we lose the information about it and don't have + // extension is unloaded, we lose the infomation about it and don't have // any in the extension preferences file. typedef std::map<std::string, FilePath> UnloadedExtensionPathMap; UnloadedExtensionPathMap unloaded_extension_paths_; |