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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/constrained_window/constrained_window_views.h" 5 #include "components/constrained_window/constrained_window_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "components/constrained_window/constrained_window_views_client.h" 9 #include "components/constrained_window/constrained_window_views_client.h"
10 #include "components/guest_view/browser/guest_view_base.h" 10 #include "components/guest_view/browser/guest_view_base.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 gfx::NativeWindow parent) { 159 gfx::NativeWindow parent) {
160 DCHECK_NE(ui::MODAL_TYPE_CHILD, dialog->GetModalType()); 160 DCHECK_NE(ui::MODAL_TYPE_CHILD, dialog->GetModalType());
161 DCHECK_NE(ui::MODAL_TYPE_NONE, dialog->GetModalType()); 161 DCHECK_NE(ui::MODAL_TYPE_NONE, dialog->GetModalType());
162 162
163 DCHECK(constrained_window_views_client); 163 DCHECK(constrained_window_views_client);
164 gfx::NativeView parent_view = 164 gfx::NativeView parent_view =
165 parent ? constrained_window_views_client->GetDialogHostView(parent) 165 parent ? constrained_window_views_client->GetDialogHostView(parent)
166 : nullptr; 166 : nullptr;
167 views::Widget* widget = 167 views::Widget* widget =
168 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent_view); 168 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent_view);
169 if (!dialog->UseNewStyleForThisDialog()) 169
170 #if defined(OS_MACOSX)
171 // On Mac, window modal dialogs are displayed as sheets, so their position is
172 // managed by the parent window.
173 bool requires_positioning = false;
174 #else
175 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.
176 #endif
177 if (!requires_positioning)
170 return widget; 178 return widget;
179
171 ModalDialogHost* host = constrained_window_views_client-> 180 ModalDialogHost* host = constrained_window_views_client->
172 GetModalDialogHost(parent); 181 GetModalDialogHost(parent);
173 if (host) { 182 if (host) {
174 DCHECK_EQ(parent_view, host->GetHostView()); 183 DCHECK_EQ(parent_view, host->GetHostView());
175 ModalDialogHostObserver* dialog_host_observer = 184 ModalDialogHostObserver* dialog_host_observer =
176 new WidgetModalDialogHostObserverViews( 185 new WidgetModalDialogHostObserverViews(
177 host, widget, kWidgetModalDialogHostObserverViewsKey); 186 host, widget, kWidgetModalDialogHostObserverViewsKey);
178 dialog_host_observer->OnPositionRequiresUpdate(); 187 dialog_host_observer->OnPositionRequiresUpdate();
179 } 188 }
180 return widget; 189 return widget;
181 } 190 }
182 191
183 } // namespace constrained window 192 } // namespace constrained window
OLDNEW
« 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