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