Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: chrome/browser/cocoa/menu_tracked_button.mm

Issue 3183013: [Mac] Don't close the Wrench menu after using the zoom buttons if the menu was opened sticky. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: nits Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/cocoa/menu_tracked_button.h" 5 #import "chrome/browser/cocoa/menu_tracked_button.h"
6 6
7 @implementation MenuTrackedButton 7 @implementation MenuTrackedButton
8 8
9 @synthesize tracking = tracking_;
10
9 - (void)mouseEntered:(NSEvent*)theEvent { 11 - (void)mouseEntered:(NSEvent*)theEvent {
10 didEnter_ = YES; 12 didEnter_ = YES;
11 [super mouseEntered:theEvent]; 13 [super mouseEntered:theEvent];
12 } 14 }
13 15
14 - (void)mouseExited:(NSEvent*)theEvent { 16 - (void)mouseExited:(NSEvent*)theEvent {
15 didEnter_ = NO; 17 didEnter_ = NO;
16 tracking_ = NO; 18 tracking_ = NO;
17 [super mouseExited:theEvent]; 19 [super mouseExited:theEvent];
18 } 20 }
19 21
20 - (void)mouseDragged:(NSEvent*)theEvent { 22 - (void)mouseDragged:(NSEvent*)theEvent {
21 tracking_ = !didEnter_; 23 tracking_ = !didEnter_;
22 [super mouseDragged:theEvent]; 24 [super mouseDragged:theEvent];
23 } 25 }
24 26
25 - (void)mouseUp:(NSEvent*)theEvent { 27 - (void)mouseUp:(NSEvent*)theEvent {
26 if (!tracking_) { 28 if (!tracking_) {
27 return [super mouseUp:theEvent]; 29 return [super mouseUp:theEvent];
28 } 30 }
29 [self performClick:self]; 31 [self performClick:self];
32 tracking_ = NO;
30 } 33 }
31 34
32 @end 35 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/menu_tracked_button.h ('k') | chrome/browser/cocoa/wrench_menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698