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

Unified Diff: components/constrained_window/constrained_window_views.cc

Issue 1309583002: [Mac] Enable MacViews bookmark editor behind --enable-mac-views-dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@modal
Patch Set: Address comments. Created 5 years, 4 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 d00551385504274b22bd5666e1d1d8496dd99168..82b01d92bb0ce33697b38f3181da5d292a769acc 100644
--- a/components/constrained_window/constrained_window_views.cc
+++ b/components/constrained_window/constrained_window_views.cc
@@ -166,8 +166,17 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
: nullptr;
views::Widget* widget =
views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent_view);
- if (!dialog->UseNewStyleForThisDialog())
+
+#if defined(OS_MACOSX)
+ // On Mac, window modal dialogs are displayed as sheets, so their position is
+ // managed by the parent window.
+ bool requires_positioning = false;
+#else
+ bool requires_positioning = dialog->UseNewStyleForThisDialog();
msw 2015/08/21 18:47:02 nit: decl/init this above the #ifdef block, and ju
jackhou1 2015/08/24 01:41:55 Done.
+#endif
+ if (!requires_positioning)
return widget;
+
ModalDialogHost* host = constrained_window_views_client->
GetModalDialogHost(parent);
if (host) {
« chrome/browser/ui/views/browser_dialogs_views.cc ('K') | « chrome/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698