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

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

Issue 1527043002: [Extensions] Don't use ExtensionInstallPrompt subclasses for auto-confirmation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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_install_prompt.cc
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc
index 6567b073d17dadaae7118a87efea28a72cad8603..b0504267839a86ce8a550ebe8a86c2cade63f36d 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -622,7 +622,8 @@ ExtensionInstallPrompt::ExtensionInstallPrompt(content::WebContents* contents)
install_ui_(extensions::CreateExtensionInstallUI(
ProfileForWebContents(contents))),
show_params_(new ExtensionInstallPromptShowParams(contents)),
- delegate_(NULL) {
+ delegate_(NULL),
+ did_call_show_dialog_(false) {
}
ExtensionInstallPrompt::ExtensionInstallPrompt(Profile* profile,
@@ -633,7 +634,8 @@ ExtensionInstallPrompt::ExtensionInstallPrompt(Profile* profile,
install_ui_(extensions::CreateExtensionInstallUI(profile)),
show_params_(
new ExtensionInstallPromptShowParams(profile, native_window)),
- delegate_(NULL) {
+ delegate_(NULL),
+ did_call_show_dialog_(false) {
}
ExtensionInstallPrompt::~ExtensionInstallPrompt() {
@@ -827,16 +829,17 @@ void ExtensionInstallPrompt::ShowConfirmation() {
}
prompt_->set_icon(gfx::Image::CreateFrom1xBitmap(icon_));
- g_last_prompt_type_for_tests = prompt_->type();
-
- if (AutoConfirmPrompt(delegate_))
- return;
-
if (show_params_->WasParentDestroyed()) {
delegate_->InstallUIAbort(false);
return;
}
+ g_last_prompt_type_for_tests = prompt_->type();
+ did_call_show_dialog_ = true;
+
+ if (AutoConfirmPrompt(delegate_))
+ return;
+
if (show_dialog_callback_.is_null())
GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_,
prompt_.Pass());

Powered by Google App Engine
This is Rietveld 408576698