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

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

Issue 1777483005: Prepare content/ module for compilation with OS X 10.7 deployment target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp89_107_ui
Patch Set: Fix bugs. 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: 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 5d079a58b01e6d9a706a13cee21c16400e424f37..da315745e62461a525c65a876da17f09081a1069 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -118,13 +118,15 @@ gfx::NativeWindow WebContentsViewMac::GetTopLevelNativeWindow() const {
}
void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const {
- // Convert bounds to window coordinate space.
- NSRect bounds =
- [cocoa_view_.get() convertRect:[cocoa_view_.get() bounds] toView:nil];
-
- // Convert bounds to screen coordinate space.
NSWindow* window = [cocoa_view_.get() window];
- bounds.origin = [window convertBaseToScreen:bounds.origin];
+ NSRect bounds = [cocoa_view_.get() bounds];
+ if (window) {
+ // Convert bounds to window coordinate space.
+ bounds = [cocoa_view_.get() convertRect:bounds toView:nil];
+
+ // Convert bounds to screen coordinate space.
+ bounds = [window convertRectToScreen:bounds];
+ }
// Flip y to account for screen flip.
NSScreen* screen = [[NSScreen screens] firstObject];

Powered by Google App Engine
This is Rietveld 408576698