summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_browsertest.cc10
-rw-r--r--chrome/browser/download/download_crx_util.cc4
2 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index dfb1a6f..94508eb2 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -170,8 +170,8 @@ class MockAbortExtensionInstallPrompt : public ExtensionInstallPrompt {
// installation.
class MockAutoConfirmExtensionInstallPrompt : public ExtensionInstallPrompt {
public:
- explicit MockAutoConfirmExtensionInstallPrompt(Profile* profile)
- : ExtensionInstallPrompt(profile) {}
+ explicit MockAutoConfirmExtensionInstallPrompt(Browser* browser)
+ : ExtensionInstallPrompt(browser) {}
// Proceed without confirmation prompt.
virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) {
@@ -1717,7 +1717,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallAcceptPermissions) {
// Install a mock install UI that simulates a user allowing permission to
// finish the install.
download_crx_util::SetMockInstallPromptForTesting(
- new MockAutoConfirmExtensionInstallPrompt(browser()->profile()));
+ new MockAutoConfirmExtensionInstallPrompt(browser()));
scoped_ptr<DownloadTestObserver> observer(
DangerousDownloadWaiter(
@@ -1748,7 +1748,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInvalid) {
// finish the install, and dismisses any error message. We check that the
// install failed below.
download_crx_util::SetMockInstallPromptForTesting(
- new MockAutoConfirmExtensionInstallPrompt(browser()->profile()));
+ new MockAutoConfirmExtensionInstallPrompt(browser()));
scoped_ptr<DownloadTestObserver> observer(
DangerousDownloadWaiter(
@@ -1776,7 +1776,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxLargeTheme) {
// Install a mock install UI that simulates a user allowing permission to
// finish the install.
download_crx_util::SetMockInstallPromptForTesting(
- new MockAutoConfirmExtensionInstallPrompt(browser()->profile()));
+ new MockAutoConfirmExtensionInstallPrompt(browser()));
scoped_ptr<DownloadTestObserver> observer(
DangerousDownloadWaiter(
diff --git a/chrome/browser/download/download_crx_util.cc b/chrome/browser/download/download_crx_util.cc
index c76dbb3..c867ad3 100644
--- a/chrome/browser/download/download_crx_util.cc
+++ b/chrome/browser/download/download_crx_util.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser_finder.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension_switch_utils.h"
#include "content/public/browser/download_item.h"
@@ -38,7 +39,8 @@ ExtensionInstallPrompt* CreateExtensionInstallPrompt(Profile* profile) {
result = mock_install_prompt_for_testing;
mock_install_prompt_for_testing = NULL;
} else {
- result = new ExtensionInstallPrompt(profile);
+ Browser* browser = browser::FindLastActiveWithProfile(profile);
+ result = new ExtensionInstallPrompt(browser);
}
return result;