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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm

Issue 657443004: MacViews: Get views based toolbar to compile on the Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views-findbar
Patch Set: Rebase Created 6 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/toolbar/toolbar_button.h" 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h"
6 6
7 @implementation ToolbarButton 7 @implementation ToolbarButton
8 8
9 @synthesize handleMiddleClick = handleMiddleClick_; 9 @synthesize handleMiddleClick = handleMiddleClick_;
10 10
11 - (void)otherMouseDown:(NSEvent*)theEvent { 11 - (void)otherMouseDown:(NSEvent*)theEvent {
12 if (![self shouldHandleEvent:theEvent]) { 12 if (![self shouldHandleEvent:theEvent]) {
13 [super otherMouseDown:theEvent]; 13 [super otherMouseDown:theEvent];
14 return; 14 return;
15 } 15 }
(...skipping 26 matching lines...) Expand all
42 [self sendAction:[self action] to:[self target]]; 42 [self sendAction:[self action] to:[self target]];
43 } 43 }
44 44
45 - (BOOL)shouldHandleEvent:(NSEvent*)theEvent { 45 - (BOOL)shouldHandleEvent:(NSEvent*)theEvent {
46 // |buttonNumber| is the mouse button whose action triggered theEvent. 46 // |buttonNumber| is the mouse button whose action triggered theEvent.
47 // 2 corresponds to the middle mouse button. 47 // 2 corresponds to the middle mouse button.
48 return handleMiddleClick_ && [theEvent buttonNumber] == 2; 48 return handleMiddleClick_ && [theEvent buttonNumber] == 2;
49 } 49 }
50 50
51 @end 51 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_button_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698