| 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]; |
| 11 if (self) { | 11 if (self) { |
| 12 trackingArea_ = | 12 trackingArea_ = |
| 13 [[NSTrackingArea alloc] initWithRect:frame | 13 [[NSTrackingArea alloc] initWithRect:frame |
| 14 options:NSTrackingMouseEnteredAndExited | | 14 options:NSTrackingMouseMoved | |
| 15 NSTrackingMouseMoved | | |
| 16 NSTrackingActiveInActiveApp | | 15 NSTrackingActiveInActiveApp | |
| 17 NSTrackingInVisibleRect | 16 NSTrackingInVisibleRect |
| 18 owner:self | 17 owner:self |
| 19 userInfo:nil]; | 18 userInfo:nil]; |
| 20 [self addTrackingArea:trackingArea_]; | 19 [self addTrackingArea:trackingArea_]; |
| 21 } | 20 } |
| 22 return self; | 21 return self; |
| 23 } | 22 } |
| 24 | 23 |
| 25 - (void)dealloc { | 24 - (void)dealloc { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 103 } |
| 105 | 104 |
| 106 - (NSRect)RectToNSRect:(gfx::Rect)rect { | 105 - (NSRect)RectToNSRect:(gfx::Rect)rect { |
| 107 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); | 106 NSRect new_rect(NSRectFromCGRect(rect.ToCGRect())); |
| 108 new_rect.origin.y = | 107 new_rect.origin.y = |
| 109 [self bounds].size.height - new_rect.origin.y - new_rect.size.height; | 108 [self bounds].size.height - new_rect.origin.y - new_rect.size.height; |
| 110 return new_rect; | 109 return new_rect; |
| 111 } | 110 } |
| 112 | 111 |
| 113 @end | 112 @end |
| OLD | NEW |