| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |