diff options
| author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-15 21:50:01 +0000 |
|---|---|---|
| committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-15 21:50:01 +0000 |
| commit | 32fc4ff7d286f7a6ee80d969672cdadaa8d3e8d0 (patch) | |
| tree | c7e59d81962c173d61083003c07819c2805fd042 /chrome/browser/ui/webui/extensions | |
| parent | 080245fa243e0c04ccea332660d3058f710a090c (diff) | |
| download | chromium_src-32fc4ff7d286f7a6ee80d969672cdadaa8d3e8d0.zip chromium_src-32fc4ff7d286f7a6ee80d969672cdadaa8d3e8d0.tar.gz chromium_src-32fc4ff7d286f7a6ee80d969672cdadaa8d3e8d0.tar.bz2 | |
Remove BrowserList::GetLastActive from extensions install dialog code by plumbing through the Browser window. In two places (file_manager_util.cc and download_crx_util.cc) there is no context so I left those with FindLastActiveWithProfile for now.
BUG=129187
Review URL: https://chromiumcodereview.appspot.com/10548057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/extensions')
| -rw-r--r-- | chrome/browser/ui/webui/extensions/extension_settings_handler.cc | 6 | ||||
| -rw-r--r-- | chrome/browser/ui/webui/extensions/install_extension_handler.cc | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index 6e01596..1605be8 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -28,6 +28,7 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/background_contents.h" +#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" #include "chrome/browser/view_type_utils.h" #include "chrome/common/chrome_notification_types.h" @@ -45,6 +46,7 @@ #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" +#include "content/public/browser/web_ui.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -600,8 +602,10 @@ void ExtensionSettingsHandler::HandleEnableMessage(const ListValue* args) { if (enable_str == "true") { ExtensionPrefs* prefs = extension_service_->extension_prefs(); if (prefs->DidExtensionEscalatePermissions(extension_id)) { + Browser* browser = browser::FindBrowserWithWebContents( + web_ui()->GetWebContents()); extensions::ShowExtensionDisabledDialog( - extension_service_, Profile::FromWebUI(web_ui()), extension); + extension_service_, browser, extension); } else { extension_service_->EnableExtension(extension_id); } diff --git a/chrome/browser/ui/webui/extensions/install_extension_handler.cc b/chrome/browser/ui/webui/extensions/install_extension_handler.cc index 3a53ff6..78b1b2c 100644 --- a/chrome/browser/ui/webui/extensions/install_extension_handler.cc +++ b/chrome/browser/ui/webui/extensions/install_extension_handler.cc @@ -12,6 +12,7 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser_finder.h" #include "chrome/common/extensions/extension_switch_utils.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" @@ -79,11 +80,13 @@ void InstallExtensionHandler::HandleInstallMessage(const ListValue* args) { return; } - Profile* profile = Profile::FromWebUI(web_ui()); + Browser* browser = browser::FindBrowserWithWebContents( + web_ui()->GetWebContents()); + Profile* profile = browser->profile(); scoped_refptr<CrxInstaller> crx_installer( CrxInstaller::Create( ExtensionSystem::Get(profile)->extension_service(), - new ExtensionInstallPrompt(profile))); + new ExtensionInstallPrompt(browser))); crx_installer->set_off_store_install_allow_reason( CrxInstaller::OffStoreInstallAllowedFromSettingsPage); |
