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

Unified Diff: ui/views/cocoa/widget_owner_nswindow_adapter.mm

Issue 1777653002: Prepare ui/ module for compilation with OS X 10.7 deployment target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More compile errors. Created 4 years, 9 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 | « ui/views/cocoa/tooltip_manager_mac.mm ('k') | ui/views/controls/menu/menu_runner_impl_cocoa.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/widget_owner_nswindow_adapter.mm
diff --git a/ui/views/cocoa/widget_owner_nswindow_adapter.mm b/ui/views/cocoa/widget_owner_nswindow_adapter.mm
index 0fbe5d545c29c9ea7262a4c7e46fa61f04d06c56..d85184ef5a445c422789135afb400eed06c1aed7 100644
--- a/ui/views/cocoa/widget_owner_nswindow_adapter.mm
+++ b/ui/views/cocoa/widget_owner_nswindow_adapter.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "base/logging.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/vector2d.h"
#import "ui/gfx/mac/coordinate_conversion.h"
@@ -72,14 +73,12 @@ NSWindow* WidgetOwnerNSWindowAdapter::GetNSWindow() {
gfx::Vector2d WidgetOwnerNSWindowAdapter::GetChildWindowOffset() const {
NSRect rect_in_window =
[anchor_view_ convertRect:[anchor_view_ bounds] toView:nil];
- // Ensure we anchor off the top-left of |anchor_view_| (rect_in_window.origin
+ NSRect rect_in_screen = [anchor_window_ convertRectToScreen:rect_in_window];
+ // Ensure we anchor off the top-left of |anchor_view_| (rect_in_screen.origin
// is the bottom-left of the view).
- // TODO(tapted): Use -[NSWindow convertRectToScreen:] when we ditch 10.6.
- NSRect rect_in_screen = NSZeroRect;
- rect_in_screen.origin =
- [anchor_window_ convertBaseToScreen:NSMakePoint(NSMinX(rect_in_window),
- NSMaxY(rect_in_window))];
- return gfx::ScreenRectFromNSRect(rect_in_screen).OffsetFromOrigin();
+ NSPoint anchor_in_screen =
+ NSMakePoint(NSMinX(rect_in_screen), NSMaxY(rect_in_screen));
+ return gfx::ScreenPointFromNSPoint(anchor_in_screen).OffsetFromOrigin();
}
bool WidgetOwnerNSWindowAdapter::IsVisibleParent() const {
« no previous file with comments | « ui/views/cocoa/tooltip_manager_mac.mm ('k') | ui/views/controls/menu/menu_runner_impl_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698