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, |