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

Unified Diff: chrome/browser/ui/views/extensions/extension_install_dialog_view.cc

Issue 1496033003: Make the webstore inline install dialog be tab-modal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/ui/views/extensions/extension_install_dialog_view.cc
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
index eb2f69df955398007840da42d3d3b5e1b1a8e5b2..19c77c4c152812137ff3ed785c1716a9f501758f 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h"
+#include <algorithm>
+#include <string>
#include <vector>
#include "base/basictypes.h"
@@ -107,8 +109,16 @@ void ShowExtensionInstallDialogImpl(
show_params->GetParentWebContents(),
delegate,
prompt);
- constrained_window::CreateBrowserModalDialogViews(
- dialog, show_params->GetParentWindow())->Show();
+ if (prompt->ShouldUseTabModalDialog()) {
+ content::WebContents* parent_web_contents =
+ show_params->GetParentWebContents();
+ if (parent_web_contents)
+ constrained_window::ShowWebModalDialogViews(dialog, parent_web_contents);
asargent_no_longer_on_chrome 2015/12/04 21:31:46 FYI, the problem I was having with this patch loca
Devlin 2015/12/04 21:53:06 Wow. That's confusing.
+ } else {
+ constrained_window::CreateBrowserModalDialogViews(
+ dialog, show_params->GetParentWindow())
+ ->Show();
+ }
}
// A custom scrollable view implementation for the dialog.
@@ -412,7 +422,7 @@ void ExtensionInstallDialogView::InitView() {
scroll_layout->AddView(issue_advice_view);
}
- DCHECK(prompt_->type() >= 0);
+ DCHECK_GE(prompt_->type(), 0);
UMA_HISTOGRAM_ENUMERATION("Extensions.InstallPrompt.Type",
prompt_->type(),
ExtensionInstallPrompt::NUM_PROMPT_TYPES);
@@ -598,7 +608,10 @@ bool ExtensionInstallDialogView::Accept() {
}
ui::ModalType ExtensionInstallDialogView::GetModalType() const {
- return ui::MODAL_TYPE_WINDOW;
+ if (prompt_->ShouldUseTabModalDialog())
Devlin 2015/12/04 21:53:06 nitty nit: ternary?
asargent_no_longer_on_chrome 2015/12/07 19:25:53 Done.
+ return ui::MODAL_TYPE_CHILD;
+ else
+ return ui::MODAL_TYPE_WINDOW;
}
void ExtensionInstallDialogView::LinkClicked(views::Link* source,

Powered by Google App Engine
This is Rietveld 408576698