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

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

Issue 199024: (Mac) Display the bookmark bar off-the-side menu on mouse down. Also align the menu. (Closed)
Patch Set: Rebased ToT. Created 11 years, 3 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
« no previous file with comments | « chrome/browser/cocoa/menu_button.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_button.h" 5 #import "chrome/browser/cocoa/menu_button.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/scoped_nsobject.h" 8 #include "base/scoped_nsobject.h"
9 #import "chrome/browser/cocoa/clickhold_button_cell.h" 9 #import "chrome/browser/cocoa/clickhold_button_cell.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 @synthesize menu = menu_; 48 @synthesize menu = menu_;
49 49
50 @end // @implementation MenuButton 50 @end // @implementation MenuButton
51 51
52 @implementation MenuButton (Private) 52 @implementation MenuButton (Private)
53 53
54 // Reset various settings of the button and its associated |ClickHoldButtonCell| 54 // Reset various settings of the button and its associated |ClickHoldButtonCell|
55 // to the standard state which provides reasonable defaults. 55 // to the standard state which provides reasonable defaults.
56 - (void)resetToDefaults { 56 - (void)resetToDefaults {
57 id cell = [self cell]; 57 ClickHoldButtonCell* cell = [self cell];
58 DCHECK([cell isKindOfClass:[ClickHoldButtonCell class]]); 58 DCHECK([cell isKindOfClass:[ClickHoldButtonCell class]]);
59 [cell setEnableClickHold:YES]; 59 [cell setEnableClickHold:YES];
60 [cell setClickHoldTimeout:0.0]; // Make menu trigger immediately. 60 [cell setClickHoldTimeout:0.0]; // Make menu trigger immediately.
61 [cell setAction:@selector(clickShowMenu:)]; 61 [cell setAction:@selector(clickShowMenu:)];
62 [cell setTarget:self]; 62 [cell setTarget:self];
63 [cell setClickHoldAction:@selector(dragShowMenu:)]; 63 [cell setClickHoldAction:@selector(dragShowMenu:)];
64 [cell setClickHoldTarget:self]; 64 [cell setClickHoldTarget:self];
65 } 65 }
66 66
67 // Actually show the menu (in the correct location). |isDragging| indicates 67 // Actually show the menu (in the correct location). |isDragging| indicates
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 - (void)clickShowMenu:(id)sender { 109 - (void)clickShowMenu:(id)sender {
110 [self showMenu:NO]; 110 [self showMenu:NO];
111 } 111 }
112 112
113 // Called when the button is clicked and dragged/held. 113 // Called when the button is clicked and dragged/held.
114 - (void)dragShowMenu:(id)sender { 114 - (void)dragShowMenu:(id)sender {
115 [self showMenu:YES]; 115 [self showMenu:YES];
116 } 116 }
117 117
118 @end // @implementation MenuButton (Private) 118 @end // @implementation MenuButton (Private)
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/menu_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698