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/menu_button.h" | 5 #import "chrome/browser/ui/cocoa/menu_button.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #import "chrome/browser/ui/cocoa/clickhold_button_cell.h" | 9 #import "chrome/browser/ui/cocoa/clickhold_button_cell.h" |
10 #import "chrome/browser/ui/cocoa/nsview_additions.h" | 10 #import "chrome/browser/ui/cocoa/nsview_additions.h" |
11 | 11 |
12 @interface MenuButton (Private) | 12 @interface MenuButton (Private) |
13 - (void)showMenu:(BOOL)isDragging; | 13 - (void)showMenu:(BOOL)isDragging; |
14 - (void)clickShowMenu:(id)sender; | 14 - (void)clickShowMenu:(id)sender; |
15 - (void)dragShowMenu:(id)sender; | 15 - (void)dragShowMenu:(id)sender; |
16 @end // @interface MenuButton (Private) | 16 @end // @interface MenuButton (Private) |
17 | 17 |
18 @implementation MenuButton | 18 @implementation MenuButton |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 174 } |
175 | 175 |
176 // Called when the button is clicked and dragged/held. | 176 // Called when the button is clicked and dragged/held. |
177 - (void)dragShowMenu:(id)sender { | 177 - (void)dragShowMenu:(id)sender { |
178 // We shouldn't get here unless the menu is enabled. | 178 // We shouldn't get here unless the menu is enabled. |
179 DCHECK([self attachedMenu]); | 179 DCHECK([self attachedMenu]); |
180 [self showMenu:YES]; | 180 [self showMenu:YES]; |
181 } | 181 } |
182 | 182 |
183 @end // @implementation MenuButton (Private) | 183 @end // @implementation MenuButton (Private) |
OLD | NEW |