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

Side by Side Diff: ui/base/cocoa/base_view.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « skia/ext/skia_utils_mac.mm ('k') | ui/base/cocoa/base_view_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/cocoa/base_view.h" 5 #include "ui/base/cocoa/base_view.h"
6 6
7 NSString* kViewDidBecomeFirstResponder = 7 NSString* kViewDidBecomeFirstResponder =
8 @"Chromium.kViewDidBecomeFirstResponder"; 8 @"Chromium.kViewDidBecomeFirstResponder";
9 NSString* kSelectionDirection = @"Chromium.kSelectionDirection"; 9 NSString* kSelectionDirection = @"Chromium.kSelectionDirection";
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 - (void)keyUp:(NSEvent*)theEvent { 126 - (void)keyUp:(NSEvent*)theEvent {
127 [self keyEvent:theEvent]; 127 [self keyEvent:theEvent];
128 } 128 }
129 129
130 - (void)flagsChanged:(NSEvent*)theEvent { 130 - (void)flagsChanged:(NSEvent*)theEvent {
131 [self keyEvent:theEvent]; 131 [self keyEvent:theEvent];
132 } 132 }
133 133
134 - (gfx::Rect)flipNSRectToRect:(NSRect)rect { 134 - (gfx::Rect)flipNSRectToRect:(NSRect)rect {
135 gfx::Rect new_rect(NSRectToCGRect(rect)); 135 gfx::Rect new_rect(NSRectToCGRect(rect));
136 new_rect.set_y([self bounds].size.height - new_rect.y() - new_rect.height()); 136 new_rect.set_y(NSHeight([self bounds]) - new_rect.bottom());
137 return new_rect; 137 return new_rect;
138 } 138 }
139 139
140 - (NSRect)flipRectToNSRect:(gfx::Rect)rect { 140 - (NSRect)flipRectToNSRect:(gfx::Rect)rect {
141 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); 141 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect()));
142 new_rect.origin.y = 142 new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect);
143 [self bounds].size.height - new_rect.origin.y - new_rect.size.height;
144 return new_rect; 143 return new_rect;
145 } 144 }
146 145
147 @end 146 @end
OLDNEW
« no previous file with comments | « skia/ext/skia_utils_mac.mm ('k') | ui/base/cocoa/base_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698