summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/webui')
-rw-r--r--chrome/browser/ui/webui/extensions/extension_settings_handler.cc6
-rw-r--r--chrome/browser/ui/webui/extensions/install_extension_handler.cc7
-rw-r--r--chrome/browser/ui/webui/ntp/app_launcher_handler.cc5
3 files changed, 13 insertions, 5 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);
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index a07b3be..58a3aae 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -983,8 +983,9 @@ ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() {
if (!extension_install_ui_.get()) {
- extension_install_ui_.reset(
- new ExtensionInstallPrompt(Profile::FromWebUI(web_ui())));
+ Browser* browser = browser::FindBrowserWithWebContents(
+ web_ui()->GetWebContents());
+ extension_install_ui_.reset(new ExtensionInstallPrompt(browser));
}
return extension_install_ui_.get();
}