OLD | NEW |
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_cocoa.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 |
(...skipping 30 matching lines...) Expand all Loading... |
41 if (isInside) | 41 if (isInside) |
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 - (void)drawFocusRingMask { |
| 52 // Match the hover image's bezel. |
| 53 [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect([self bounds], 2, 2) |
| 54 xRadius:2 |
| 55 yRadius:2] fill]; |
| 56 } |
| 57 |
51 @end | 58 @end |
OLD | NEW |