Chromium Code Reviews| 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(); |
| } |