OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/cocoa/menu_tracked_button.h" |
| 6 |
| 7 @implementation MenuTrackedButton |
| 8 |
| 9 - (void)mouseEntered:(NSEvent*)theEvent { |
| 10 didEnter_ = YES; |
| 11 [super mouseEntered:theEvent]; |
| 12 } |
| 13 |
| 14 - (void)mouseExited:(NSEvent*)theEvent { |
| 15 didEnter_ = NO; |
| 16 tracking_ = NO; |
| 17 [super mouseExited:theEvent]; |
| 18 } |
| 19 |
| 20 - (void)mouseDragged:(NSEvent*)theEvent { |
| 21 tracking_ = !didEnter_; |
| 22 [super mouseDragged:theEvent]; |
| 23 } |
| 24 |
| 25 - (void)mouseUp:(NSEvent*)theEvent { |
| 26 if (!tracking_) { |
| 27 return [super mouseUp:theEvent]; |
| 28 } |
| 29 [self performClick:self]; |
| 30 } |
| 31 |
| 32 @end |
OLD | NEW |