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 def5232fc9782603559d380c6499264f1c8ac6b5..9b6c21b50b0e70d98bc7ba13198c8376ac107f3a 100644 |
| --- a/components/constrained_window/constrained_window_views.cc |
| +++ b/components/constrained_window/constrained_window_views.cc |
| @@ -141,11 +141,29 @@ 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()); |
| + web_modal::WebContentsModalDialogManager* manager = |
| + web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); |
| + manager->ShowModalDialog(widget->GetNativeWindow()); |
| return widget; |
| } |
| +#if defined(OS_MACOSX) |
| +views::Widget* ShowWebModalDialogWithOverlayViews( |
|
tapted
2016/05/31 07:44:48
This might be a long shot, but can this entire met
Patti Lor
2016/06/06 06:52:46
This seems to work? I don't understand it though -
tapted
2016/06/07 06:10:02
Yeah, it's "fine" to provide the function prototyp
|
| + views::WidgetDelegate* dialog, |
| + content::WebContents* initiator_web_contents) { |
| + DCHECK(constrained_window_views_client); |
| + // For embedded WebContents, use the embedder's WebContents for constrained |
| + // window. |
| + content::WebContents* web_contents = |
| + guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents); |
| + views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents); |
| + web_modal::WebContentsModalDialogManager* manager = |
| + web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); |
| + manager->ShowModalDialogWithOverlay(widget->GetNativeWindow()); |
| + return widget; |
| +} |
| +#endif |
| + |
| views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, |
| content::WebContents* web_contents) { |
| DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType()); |
| @@ -192,4 +210,4 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, |
| return widget; |
| } |
| -} // namespace constrained window |
| +} // namespace constrained_window |