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

Unified Diff: chrome/browser/ui/cocoa/extensions/shell_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
Index: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
index c07553f33faa257400803aefc88f6a61c39f9de5..9aa5653ac58d566ab7d26c035cdd5272f9f50949 100644
--- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
@@ -72,8 +72,8 @@ gfx::Rect ShellWindowCocoa::GetRestoredBounds() const {
// Flip coordinates based on the primary screen.
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
NSRect frame = [window() frame];
- 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;
}
@@ -135,8 +135,7 @@ void ShellWindowCocoa::SetBounds(const gfx::Rect& bounds) {
checked_bounds.height());
// Flip coordinates based on the primary screen.
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
- cocoa_bounds.origin.y =
- [screen frame].size.height - checked_bounds.height() - checked_bounds.y();
+ cocoa_bounds.origin.y = NSHeight([screen frame]) - checked_bounds.bottom();
[window() setFrame:cocoa_bounds display:YES];
}
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_item_cell.mm ('k') | chrome/browser/ui/cocoa/image_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698