Commit 4d99af5b authored by mblsha's avatar mblsha Committed by Commit bot

Replace manual y coordinate flipping with gfx::ScreenRectFromNSRect().

BUG=None

Review-Url: https://codereview.chromium.org/2621143003
Cr-Commit-Position: refs/heads/master@{#443181}
parent 2d136863
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "ui/base/dragdrop/cocoa_dnd_util.h" #include "ui/base/dragdrop/cocoa_dnd_util.h"
#include "ui/display/screen.h" #include "ui/display/screen.h"
#include "ui/gfx/image/image_skia_util_mac.h" #include "ui/gfx/image/image_skia_util_mac.h"
#include "ui/gfx/mac/coordinate_conversion.h"
using blink::WebDragOperation; using blink::WebDragOperation;
using blink::WebDragOperationsMask; using blink::WebDragOperationsMask;
...@@ -163,11 +164,7 @@ void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const { ...@@ -163,11 +164,7 @@ void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const {
bounds = [window convertRectToScreen:bounds]; bounds = [window convertRectToScreen:bounds];
} }
// Flip y to account for screen flip. *out = gfx::ScreenRectFromNSRect(bounds);
NSScreen* screen = [[NSScreen screens] firstObject];
bounds.origin.y = [screen frame].size.height - bounds.origin.y
- bounds.size.height;
*out = gfx::Rect(NSRectToCGRect(bounds));
} }
void WebContentsViewMac::StartDragging( void WebContentsViewMac::StartDragging(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment