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

Unified Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 10545050: mac: Use NSWidth() and friends in a few more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 6 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 | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 9f75da34ab49ac6d57178845024f1ea10f20e232..55451384ac63f484df19f59a596721d8ab5c5c00 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -146,7 +146,7 @@ void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) {
// Flip coordinates based on the primary screen.
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
cocoa_bounds.origin.y =
- [screen frame].size.height - real_bounds.height() - real_bounds.y();
+ NSHeight([screen frame]) - real_bounds.height() - real_bounds.y();
[window() setFrame:cocoa_bounds display:YES];
}
@@ -268,8 +268,8 @@ gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const {
// Flip coordinates based on the primary screen.
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
NSRect frame = [controller_ regularWindowFrame];
- gfx::Rect bounds(frame.origin.x, 0, frame.size.width, frame.size.height);
- bounds.set_y([screen frame].size.height - frame.origin.y - frame.size.height);
+ gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
+ bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));
return bounds;
}
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698