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

Unified 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, 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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/views_nswindow_delegate.mm
diff --git a/ui/views/cocoa/views_nswindow_delegate.mm b/ui/views/cocoa/views_nswindow_delegate.mm
index d8f1a8230ab989930baca03a532e22e620ec40be..75346a6a8076dadb929abc2f858e5a2cf57e6892 100644
--- a/ui/views/cocoa/views_nswindow_delegate.mm
+++ b/ui/views/cocoa/views_nswindow_delegate.mm
@@ -130,4 +130,16 @@
return proposedSize;
}
+// Override to correctly position modal dialogs.
+- (NSRect)window:(NSWindow*)window
+ willPositionSheet:(NSWindow*)sheet
+ usingRect:(NSRect)defaultSheetLocation {
+ // As per NSWindowDelegate documentation, the origin indicates the top left
+ // point of the host frame in window coordinates. The width changes the
+ // animation from vertical to trapezoid if it is smaller than the width of the
+ // dialog. The height is ignored but should be set to zero.
+ return NSMakeRect(0, [self nativeWidgetMac]->SheetPositionY(),
+ NSWidth(defaultSheetLocation), 0);
+}
+
@end
« 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