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

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: 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
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..82909a4135bc278e7dbfd9743fe9a3c326e128f5 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 "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/vector2d.h"
#import "ui/gfx/mac/coordinate_conversion.h"
@@ -74,11 +75,10 @@ gfx::Vector2d WidgetOwnerNSWindowAdapter::GetChildWindowOffset() const {
[anchor_view_ convertRect:[anchor_view_ bounds] toView:nil];
// Ensure we anchor off the top-left of |anchor_view_| (rect_in_window.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))];
+ rect_in_screen.origin = ui::ConvertPointFromWindowToScreen(
+ anchor_window_,
+ NSMakePoint(NSMinX(rect_in_window), NSMaxY(rect_in_window)));
Avi (use Gerrit) 2016/03/08 20:07:54 Can we rewrite this so we do: NSRect rect_in_wind
erikchen 2016/03/08 20:57:41 Done.
return gfx::ScreenRectFromNSRect(rect_in_screen).OffsetFromOrigin();
}

Powered by Google App Engine
This is Rietveld 408576698