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 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
7 | 8 |
8 NSString* kViewDidBecomeFirstResponder = | 9 NSString* kViewDidBecomeFirstResponder = |
9 @"Chromium.kViewDidBecomeFirstResponder"; | 10 @"Chromium.kViewDidBecomeFirstResponder"; |
10 NSString* kSelectionDirection = @"Chromium.kSelectionDirection"; | 11 NSString* kSelectionDirection = @"Chromium.kSelectionDirection"; |
11 | 12 |
12 @implementation BaseView | 13 @implementation BaseView |
13 | 14 |
14 - (instancetype)initWithFrame:(NSRect)frame { | 15 - (instancetype)initWithFrame:(NSRect)frame { |
15 if ((self = [super initWithFrame:frame])) { | 16 if ((self = [super initWithFrame:frame])) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 return new_rect; | 177 return new_rect; |
177 } | 178 } |
178 | 179 |
179 - (NSRect)flipRectToNSRect:(gfx::Rect)rect { | 180 - (NSRect)flipRectToNSRect:(gfx::Rect)rect { |
180 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); | 181 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); |
181 new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect); | 182 new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect); |
182 return new_rect; | 183 return new_rect; |
183 } | 184 } |
184 | 185 |
185 @end | 186 @end |
OLD | NEW |