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

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: incorporated review suggestions 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
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ff1ac90f583c27c2c9a888504cb702c9e3ccee14 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);
+ } 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,8 @@ bool ExtensionInstallDialogView::Accept() {
}
ui::ModalType ExtensionInstallDialogView::GetModalType() const {
- return ui::MODAL_TYPE_WINDOW;
+ return prompt_->ShouldUseTabModalDialog() ? ui::MODAL_TYPE_CHILD
+ : ui::MODAL_TYPE_WINDOW;
}
void ExtensionInstallDialogView::LinkClicked(views::Link* source,
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698