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

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
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bool requires_positioning = dialog->UseNewStyleForThisDialog();
171
172 #if defined(OS_MACOSX)
173 // On Mac, window modal dialogs are displayed as sheets, so their position is
174 // managed by the parent window.
175 requires_positioning = false;
176 #endif
177
178 if (!requires_positioning)
170 return widget; 179 return widget;
180
171 ModalDialogHost* host = constrained_window_views_client-> 181 ModalDialogHost* host = constrained_window_views_client->
172 GetModalDialogHost(parent); 182 GetModalDialogHost(parent);
173 if (host) { 183 if (host) {
174 DCHECK_EQ(parent_view, host->GetHostView()); 184 DCHECK_EQ(parent_view, host->GetHostView());
175 ModalDialogHostObserver* dialog_host_observer = 185 ModalDialogHostObserver* dialog_host_observer =
176 new WidgetModalDialogHostObserverViews( 186 new WidgetModalDialogHostObserverViews(
177 host, widget, kWidgetModalDialogHostObserverViewsKey); 187 host, widget, kWidgetModalDialogHostObserverViewsKey);
178 dialog_host_observer->OnPositionRequiresUpdate(); 188 dialog_host_observer->OnPositionRequiresUpdate();
179 } 189 }
180 return widget; 190 return widget;
181 } 191 }
182 192
183 } // namespace constrained window 193 } // namespace constrained window
OLDNEW
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698