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

Unified Diff: components/constrained_window/constrained_window_views.cc

Issue 2357243003: [UI] Make auto-resizable constrained web dialog work even when initiated (Closed)
Patch Set: Created 4 years, 3 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 15fad72bf5bac3f6b9882971a16bc56e439901e4..ccdfdd1606700fa05b4f4d4cfdd5ab52e98489c2 100644
--- a/components/constrained_window/constrained_window_views.cc
+++ b/components/constrained_window/constrained_window_views.cc
@@ -145,6 +145,12 @@ void UpdateWidgetModalDialogPosition(views::Widget* widget,
widget->GetRootView()->GetPreferredSize());
}
+content::WebContents* GetTopLevelWebContents(
msw 2016/09/22 13:36:19 nit: maybe just skip the helper and inline calls t
wjmaclean 2016/09/22 15:36:48 Wouldn't that mean that the guestview interface wo
imcheng 2016/09/22 17:20:58 Yeah, I did it this way so I don't have to include
msw 2016/09/22 20:45:17 Ah, then this is fine, thanks.
+ content::WebContents* initiator_web_contents) {
+ return guest_view::GuestViewBase::GetTopLevelWebContents(
+ initiator_web_contents);
+}
+
views::Widget* ShowWebModalDialogViews(
views::WidgetDelegate* dialog,
content::WebContents* initiator_web_contents) {
@@ -152,7 +158,7 @@ views::Widget* ShowWebModalDialogViews(
// For embedded WebContents, use the embedder's WebContents for constrained
// window.
content::WebContents* web_contents =
- guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents);
+ GetTopLevelWebContents(initiator_web_contents);
views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents);
ShowModalDialog(widget->GetNativeWindow(), web_contents);
return widget;
@@ -166,7 +172,7 @@ views::Widget* ShowWebModalDialogWithOverlayViews(
// For embedded WebContents, use the embedder's WebContents for constrained
// window.
content::WebContents* web_contents =
- guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents);
+ GetTopLevelWebContents(initiator_web_contents);
views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents);
web_modal::WebContentsModalDialogManager* manager =
web_modal::WebContentsModalDialogManager::FromWebContents(web_contents);

Powered by Google App Engine
This is Rietveld 408576698