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

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 2621143003: Replace manual y coordinate flipping with gfx::ScreenRectFromNSRect(). (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index ea529e53428cb29d8f780612fbeb6cb9efea57cc..1d01ac835dbe810121a24de1a4014f1bd4de4307 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -32,6 +32,7 @@
#include "ui/base/dragdrop/cocoa_dnd_util.h"
#include "ui/display/screen.h"
#include "ui/gfx/image/image_skia_util_mac.h"
+#include "ui/gfx/mac/coordinate_conversion.h"
using blink::WebDragOperation;
using blink::WebDragOperationsMask;
@@ -163,11 +164,7 @@ void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const {
bounds = [window convertRectToScreen:bounds];
}
- // Flip y to account for screen flip.
- NSScreen* screen = [[NSScreen screens] firstObject];
- bounds.origin.y = [screen frame].size.height - bounds.origin.y
- - bounds.size.height;
- *out = gfx::Rect(NSRectToCGRect(bounds));
+ *out = gfx::ScreenRectFromNSRect(bounds);
}
void WebContentsViewMac::StartDragging(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698