Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3493)

Unified Diff: chrome/browser/extensions/extension_browsertest.cc

Issue 10699057: Move application creation and extension install prompt showing off Browser and onto ExtensionTabHel… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_browsertest.cc
===================================================================
--- chrome/browser/extensions/extension_browsertest.cc (revision 145357)
+++ chrome/browser/extensions/extension_browsertest.cc (working copy)
@@ -231,7 +231,8 @@
// This class is used to simulate an installation abort by the user.
class MockAbortExtensionInstallPrompt : public ExtensionInstallPrompt {
public:
- MockAbortExtensionInstallPrompt() : ExtensionInstallPrompt(NULL) {}
+ MockAbortExtensionInstallPrompt() : ExtensionInstallPrompt(NULL, NULL, NULL) {
+ }
// Simulate a user abort on an extension installation.
virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) {
@@ -246,8 +247,10 @@
class MockAutoConfirmExtensionInstallPrompt : public ExtensionInstallPrompt {
public:
- explicit MockAutoConfirmExtensionInstallPrompt(Browser* browser) :
- ExtensionInstallPrompt(browser) {}
+ explicit MockAutoConfirmExtensionInstallPrompt(
+ gfx::NativeWindow parent,
+ content::PageNavigator* navigator,
+ Profile* profile) : ExtensionInstallPrompt(parent, navigator, profile) {}
// Proceed without confirmation prompt.
virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) {
@@ -284,12 +287,18 @@
{
ExtensionInstallPrompt* install_ui = NULL;
- if (ui_type == INSTALL_UI_TYPE_CANCEL)
+ if (ui_type == INSTALL_UI_TYPE_CANCEL) {
install_ui = new MockAbortExtensionInstallPrompt();
- else if (ui_type == INSTALL_UI_TYPE_NORMAL)
- install_ui = new ExtensionInstallPrompt(browser);
- else if (ui_type == INSTALL_UI_TYPE_AUTO_CONFIRM)
- install_ui = new MockAutoConfirmExtensionInstallPrompt(browser);
+ } else if (ui_type == INSTALL_UI_TYPE_NORMAL) {
+ install_ui = chrome::CreateExtensionInstallPromptWithBrowser(browser);
+ } else if (ui_type == INSTALL_UI_TYPE_AUTO_CONFIRM) {
+ gfx::NativeWindow parent =
+ browser->window() ? browser->window()->GetNativeWindow() : NULL;
+ install_ui = new MockAutoConfirmExtensionInstallPrompt(
+ parent,
+ browser,
+ browser->profile());
+ }
// TODO(tessamac): Update callers to always pass an unpacked extension
// and then always pack the extension here.
« no previous file with comments | « chrome/browser/extensions/crx_installer_browsertest.cc ('k') | chrome/browser/extensions/extension_disabled_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698