OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/ui/cocoa/hover_button.h" | 5 #import "ui/base/cocoa/hover_button.h" |
6 | 6 |
7 @implementation HoverButton | 7 @implementation HoverButton |
8 | 8 |
9 @synthesize hoverState = hoverState_; | 9 @synthesize hoverState = hoverState_; |
10 | 10 |
11 - (id)initWithFrame:(NSRect)frameRect { | 11 - (id)initWithFrame:(NSRect)frameRect { |
12 if ((self = [super initWithFrame:frameRect])) { | 12 if ((self = [super initWithFrame:frameRect])) { |
13 [self setTrackingEnabled:YES]; | 13 [self setTrackingEnabled:YES]; |
14 hoverState_ = kHoverStateNone; | 14 hoverState_ = kHoverStateNone; |
15 [self updateTrackingAreas]; | 15 [self updateTrackingAreas]; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 self.hoverState = NSPointInRect(mouseLoc, [self bounds]) ? | 97 self.hoverState = NSPointInRect(mouseLoc, [self bounds]) ? |
98 kHoverStateMouseOver : kHoverStateNone; | 98 kHoverStateMouseOver : kHoverStateNone; |
99 } | 99 } |
100 | 100 |
101 - (void)setHoverState:(HoverState)state { | 101 - (void)setHoverState:(HoverState)state { |
102 hoverState_ = state; | 102 hoverState_ = state; |
103 [self setNeedsDisplay:YES]; | 103 [self setNeedsDisplay:YES]; |
104 } | 104 } |
105 | 105 |
106 @end | 106 @end |
OLD | NEW |