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

Side by Side Diff: ui/views/cocoa/views_nswindow_delegate.mm

Issue 1315043003: [MacViews] Position modal sheets using ModalDialogHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bbobserver
Patch Set: Missded a comment nit. Created 5 years, 3 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/browser/ui/views/frame/browser_frame_mac.mm ('k') | ui/views/widget/native_widget_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "ui/views/cocoa/views_nswindow_delegate.h" 5 #import "ui/views/cocoa/views_nswindow_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "ui/views/cocoa/bridged_content_view.h" 8 #import "ui/views/cocoa/bridged_content_view.h"
9 #import "ui/views/cocoa/bridged_native_widget.h" 9 #import "ui/views/cocoa/bridged_native_widget.h"
10 #include "ui/views/widget/native_widget_mac.h" 10 #include "ui/views/widget/native_widget_mac.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Allow non-resizable windows (without NSResizableWindowMask) to fill the 123 // Allow non-resizable windows (without NSResizableWindowMask) to fill the
124 // screen in fullscreen mode. This only happens when 124 // screen in fullscreen mode. This only happens when
125 // -[NSWindow toggleFullscreen:] is called since non-resizable windows have no 125 // -[NSWindow toggleFullscreen:] is called since non-resizable windows have no
126 // fullscreen button. Without this they would only enter fullscreen at their 126 // fullscreen button. Without this they would only enter fullscreen at their
127 // current size. 127 // current size.
128 - (NSSize)window:(NSWindow*)window 128 - (NSSize)window:(NSWindow*)window
129 willUseFullScreenContentSize:(NSSize)proposedSize { 129 willUseFullScreenContentSize:(NSSize)proposedSize {
130 return proposedSize; 130 return proposedSize;
131 } 131 }
132 132
133 // Override to correctly position modal dialogs.
134 - (NSRect)window:(NSWindow*)window
135 willPositionSheet:(NSWindow*)sheet
136 usingRect:(NSRect)defaultSheetLocation {
137 // As per NSWindowDelegate documentation, the origin indicates the top left
138 // point of the host frame in window coordinates. The width changes the
139 // animation from vertical to trapezoid if it is smaller than the width of the
140 // dialog. The height is ignored but should be set to zero.
141 return NSMakeRect(0, [self nativeWidgetMac]->SheetPositionY(),
142 NSWidth(defaultSheetLocation), 0);
143 }
144
133 @end 145 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_mac.mm ('k') | ui/views/widget/native_widget_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698