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

Unified Diff: components/constrained_window/constrained_window_views.cc

Issue 2087643003: Move web modal dialog manager files into the constrained_window component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase? Created 4 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: components/constrained_window/constrained_window_views.cc
diff --git a/components/constrained_window/constrained_window_views.cc b/components/constrained_window/constrained_window_views.cc
index def5232fc9782603559d380c6499264f1c8ac6b5..f6dbb06becea833c56c2ec9b23f3edc6ae1115ab 100644
--- a/components/constrained_window/constrained_window_views.cc
+++ b/components/constrained_window/constrained_window_views.cc
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "build/build_config.h"
#include "components/constrained_window/constrained_window_views_client.h"
+#include "components/constrained_window/native_web_contents_modal_dialog_manager_views.h"
#include "components/guest_view/browser/guest_view_base.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
@@ -132,6 +133,17 @@ void UpdateWidgetModalDialogPosition(views::Widget* widget,
widget->GetRootView()->GetPreferredSize());
}
+void ShowModalDialog(gfx::NativeWindow dialog,
+ content::WebContents* initiator_web_contents) {
+ web_modal::WebContentsModalDialogManager* manager =
+ web_modal::WebContentsModalDialogManager::FromWebContents(
+ initiator_web_contents);
+ std::unique_ptr<web_modal::SingleWebContentsDialogManager> dialog_manager(
+ web_modal::WebContentsModalDialogManager::CreateNativeWebModalManager(
tapted 2016/06/29 03:02:45 Can this just call NativeWebContentsModalDialogMan
Patti Lor 2016/07/13 03:09:41 I don't think so - there are 4 separate implementa
tapted 2016/07/13 04:36:19 The notreached ones shouldn't matter (I think they
Patti Lor 2016/07/19 07:39:08 Done (including deleting the other implementations
+ dialog, manager));
+ manager->ShowDialogWithManager(dialog, std::move(dialog_manager));
+}
+
views::Widget* ShowWebModalDialogViews(
views::WidgetDelegate* dialog,
content::WebContents* initiator_web_contents) {
@@ -141,8 +153,7 @@ views::Widget* ShowWebModalDialogViews(
content::WebContents* web_contents =
guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents);
views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents);
- web_modal::WebContentsModalDialogManager::FromWebContents(web_contents)
- ->ShowModalDialog(widget->GetNativeWindow());
+ ShowModalDialog(widget->GetNativeWindow(), initiator_web_contents);
return widget;
}

Powered by Google App Engine
This is Rietveld 408576698