OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 @interface ToolbarController | 47 @interface ToolbarController |
48 : NSViewController<URLDropTargetController, HasWeakBrowserPointer> { | 48 : NSViewController<URLDropTargetController, HasWeakBrowserPointer> { |
49 @protected | 49 @protected |
50 // The ordering is important for unit tests. If new items are added or the | 50 // The ordering is important for unit tests. If new items are added or the |
51 // ordering is changed, make sure to update |-toolbarViews| and the | 51 // ordering is changed, make sure to update |-toolbarViews| and the |
52 // corresponding enum in the unit tests. | 52 // corresponding enum in the unit tests. |
53 IBOutlet MenuButton* backButton_; | 53 IBOutlet MenuButton* backButton_; |
54 IBOutlet MenuButton* forwardButton_; | 54 IBOutlet MenuButton* forwardButton_; |
55 IBOutlet ReloadButton* reloadButton_; | 55 IBOutlet ReloadButton* reloadButton_; |
56 IBOutlet ToolbarButton* homeButton_; | 56 IBOutlet ToolbarButton* homeButton_; |
57 IBOutlet MenuButton* wrenchButton_; | 57 IBOutlet MenuButton* appMenuButton_; |
58 IBOutlet AutocompleteTextField* locationBar_; | 58 IBOutlet AutocompleteTextField* locationBar_; |
59 IBOutlet BrowserActionsContainerView* browserActionsContainerView_; | 59 IBOutlet BrowserActionsContainerView* browserActionsContainerView_; |
60 | 60 |
61 @private | 61 @private |
62 CommandUpdater* commands_; // weak, one per window | 62 CommandUpdater* commands_; // weak, one per window |
63 Profile* profile_; // weak, one per window | 63 Profile* profile_; // weak, one per window |
64 Browser* browser_; // weak, one per window | 64 Browser* browser_; // weak, one per window |
65 scoped_ptr<ToolbarControllerInternal::CommandObserverBridge> commandObserver_; | 65 scoped_ptr<ToolbarControllerInternal::CommandObserverBridge> commandObserver_; |
66 scoped_ptr<LocationBarViewMac> locationBarView_; | 66 scoped_ptr<LocationBarViewMac> locationBarView_; |
67 base::scoped_nsobject<AutocompleteTextFieldEditor> | 67 base::scoped_nsobject<AutocompleteTextFieldEditor> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 // Create and add the Browser Action buttons to the toolbar view. | 165 // Create and add the Browser Action buttons to the toolbar view. |
166 - (void)createBrowserActionButtons; | 166 - (void)createBrowserActionButtons; |
167 | 167 |
168 // Updates the visibility of the toolbar, with an optional animation. | 168 // Updates the visibility of the toolbar, with an optional animation. |
169 - (void)updateVisibility:(BOOL)visible withAnimation:(BOOL)animate; | 169 - (void)updateVisibility:(BOOL)visible withAnimation:(BOOL)animate; |
170 | 170 |
171 // Return the BrowserActionsController for this toolbar. | 171 // Return the BrowserActionsController for this toolbar. |
172 - (BrowserActionsController*)browserActionsController; | 172 - (BrowserActionsController*)browserActionsController; |
173 | 173 |
174 // Returns the wrench button. | 174 // Returns the app menu button. |
175 - (NSButton*)wrenchButton; | 175 - (NSButton*)appMenuButton; |
176 | 176 |
177 // Returns the app menu controller. | 177 // Returns the app menu controller. |
178 - (AppMenuController*)appMenuController; | 178 - (AppMenuController*)appMenuController; |
179 | 179 |
180 @end | 180 @end |
181 | 181 |
182 // A set of private methods used by tests, in the absence of "friends" in ObjC. | 182 // A set of private methods used by tests, in the absence of "friends" in ObjC. |
183 @interface ToolbarController(PrivateTestMethods) | 183 @interface ToolbarController(PrivateTestMethods) |
184 // Returns an array of views in the order of the outlets above. | 184 // Returns an array of views in the order of the outlets above. |
185 - (NSArray*)toolbarViews; | 185 - (NSArray*)toolbarViews; |
186 - (void)showOptionalHomeButton; | 186 - (void)showOptionalHomeButton; |
187 - (void)installWrenchMenu; | 187 - (void)installAppMenu; |
188 // Return a hover button for the current event. | 188 // Return a hover button for the current event. |
189 - (NSButton*)hoverButtonForEvent:(NSEvent*)theEvent; | 189 - (NSButton*)hoverButtonForEvent:(NSEvent*)theEvent; |
190 @end | 190 @end |
191 | 191 |
192 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_CONTROLLER_H_ | 192 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_CONTROLLER_H_ |
OLD | NEW |