Chromium Code Reviews| 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 d00551385504274b22bd5666e1d1d8496dd99168..5b957458922acb1ae3a4154099370242bc5ab938 100644 |
| --- a/components/constrained_window/constrained_window_views.cc |
| +++ b/components/constrained_window/constrained_window_views.cc |
| @@ -130,6 +130,15 @@ void UpdateWidgetModalDialogPosition(views::Widget* widget, |
| widget->GetRootView()->GetPreferredSize()); |
| } |
| +bool HasTopLevelDialogManager(content::WebContents* web_contents) { |
| + // For embedded WebContents, use the embedder's WebContents for constrained |
| + // window. |
| + content::WebContents* top_level_web_contents = |
| + guest_view::GuestViewBase::GetTopLevelWebContents(web_contents); |
|
jochen (gone - plz use gerrit)
2015/07/15 13:34:01
is the return value guaranteed to be non-NULL? it'
wjmaclean
2015/07/15 13:59:58
Yes, the return value is guaranteed to be non-null
|
| + return web_modal::WebContentsModalDialogManager::FromWebContents( |
| + top_level_web_contents) != nullptr; |
| +} |
| + |
| views::Widget* ShowWebModalDialogViews( |
| views::WidgetDelegate* dialog, |
| content::WebContents* initiator_web_contents) { |