| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/cocoa/base_view.h" | 5 #include "chrome/browser/cocoa/base_view.h" |
| 6 | 6 |
| 7 @implementation BaseView | 7 @implementation BaseView |
| 8 | 8 |
| 9 - (id)initWithFrame:(NSRect)frame { | 9 - (id)initWithFrame:(NSRect)frame { |
| 10 self = [super initWithFrame:frame]; | 10 self = [super initWithFrame:frame]; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 - (void)keyDown:(NSEvent *)theEvent { | 87 - (void)keyDown:(NSEvent *)theEvent { |
| 88 [self keyEvent:theEvent]; | 88 [self keyEvent:theEvent]; |
| 89 } | 89 } |
| 90 | 90 |
| 91 - (void)keyUp:(NSEvent *)theEvent { | 91 - (void)keyUp:(NSEvent *)theEvent { |
| 92 [self keyEvent:theEvent]; | 92 [self keyEvent:theEvent]; |
| 93 } | 93 } |
| 94 | 94 |
| 95 - (BOOL)isOpaque { | |
| 96 return YES; | |
| 97 } | |
| 98 | |
| 99 - (gfx::Rect)NSRectToRect:(NSRect)rect { | 95 - (gfx::Rect)NSRectToRect:(NSRect)rect { |
| 100 gfx::Rect new_rect(NSRectToCGRect(rect)); | 96 gfx::Rect new_rect(NSRectToCGRect(rect)); |
| 101 new_rect.set_y([self bounds].size.height - new_rect.y() - new_rect.height()); | 97 new_rect.set_y([self bounds].size.height - new_rect.y() - new_rect.height()); |
| 102 return new_rect; | 98 return new_rect; |
| 103 } | 99 } |
| 104 | 100 |
| 105 - (NSRect)RectToNSRect:(gfx::Rect)rect { | 101 - (NSRect)RectToNSRect:(gfx::Rect)rect { |
| 106 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); | 102 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); |
| 107 new_rect.origin.y = | 103 new_rect.origin.y = |
| 108 [self bounds].size.height - new_rect.origin.y - new_rect.size.height; | 104 [self bounds].size.height - new_rect.origin.y - new_rect.size.height; |
| 109 return new_rect; | 105 return new_rect; |
| 110 } | 106 } |
| 111 | 107 |
| 112 @end | 108 @end |
| OLD | NEW |