OLD | NEW |
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 #ifndef CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ |
6 #define CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // setMouseInside:animate:. | 92 // setMouseInside:animate:. |
93 NSButton* hoveredButton_; | 93 NSButton* hoveredButton_; |
94 | 94 |
95 // The ordering is important for unit tests. If new items are added or the | 95 // The ordering is important for unit tests. If new items are added or the |
96 // ordering is changed, make sure to update |-toolbarViews| and the | 96 // ordering is changed, make sure to update |-toolbarViews| and the |
97 // corresponding enum in the unit tests. | 97 // corresponding enum in the unit tests. |
98 IBOutlet DelayedMenuButton* backButton_; | 98 IBOutlet DelayedMenuButton* backButton_; |
99 IBOutlet DelayedMenuButton* forwardButton_; | 99 IBOutlet DelayedMenuButton* forwardButton_; |
100 IBOutlet NSButton* reloadButton_; | 100 IBOutlet NSButton* reloadButton_; |
101 IBOutlet NSButton* homeButton_; | 101 IBOutlet NSButton* homeButton_; |
102 IBOutlet NSButton* starButton_; | |
103 IBOutlet NSButton* goButton_; | 102 IBOutlet NSButton* goButton_; |
104 IBOutlet MenuButton* pageButton_; | 103 IBOutlet MenuButton* pageButton_; |
105 IBOutlet MenuButton* wrenchButton_; | 104 IBOutlet MenuButton* wrenchButton_; |
106 IBOutlet AutocompleteTextField* locationBar_; | 105 IBOutlet AutocompleteTextField* locationBar_; |
107 IBOutlet BrowserActionsContainerView* browserActionsContainerView_; | 106 IBOutlet BrowserActionsContainerView* browserActionsContainerView_; |
108 } | 107 } |
109 | 108 |
110 // Initialize the toolbar and register for command updates. The profile is | 109 // Initialize the toolbar and register for command updates. The profile is |
111 // needed for initializing the location bar. The browser is needed for | 110 // needed for initializing the location bar. The browser is needed for |
112 // initializing the back/forward menus. | 111 // initializing the back/forward menus. |
(...skipping 27 matching lines...) Expand all Loading... |
140 | 139 |
141 // Called to update the loading state. Handles updating the go/stop button | 140 // Called to update the loading state. Handles updating the go/stop button |
142 // state. | 141 // state. |
143 - (void)setIsLoading:(BOOL)isLoading; | 142 - (void)setIsLoading:(BOOL)isLoading; |
144 | 143 |
145 // Allow turning off the toolbar (but we may keep the location bar without a | 144 // Allow turning off the toolbar (but we may keep the location bar without a |
146 // surrounding toolbar). If |toolbar| is YES, the value of |hasLocationBar| is | 145 // surrounding toolbar). If |toolbar| is YES, the value of |hasLocationBar| is |
147 // ignored. This changes the behavior of other methods, like |-view|. | 146 // ignored. This changes the behavior of other methods, like |-view|. |
148 - (void)setHasToolbar:(BOOL)toolbar hasLocationBar:(BOOL)locBar; | 147 - (void)setHasToolbar:(BOOL)toolbar hasLocationBar:(BOOL)locBar; |
149 | 148 |
150 // The bookmark bubble (when you click the star) needs to know where to go. | 149 // The bookmark bubble (when you click the star or hit Command-d) |
151 // Somewhere near the star button seems like a good start. | 150 // needs to know where to go. Somewhere near the star icon seems like |
152 - (NSRect)starButtonInWindowCoordinates; | 151 // a good start. |
| 152 - (NSRect)starIconInWindowCoordinates; |
153 | 153 |
154 // Returns the desired toolbar height for the given compression factor. | 154 // Returns the desired toolbar height for the given compression factor. |
155 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight; | 155 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight; |
156 | 156 |
157 // Set the opacity of the divider (the line at the bottom) *if* we have a | 157 // Set the opacity of the divider (the line at the bottom) *if* we have a |
158 // |ToolbarView| (0 means don't show it); no-op otherwise. | 158 // |ToolbarView| (0 means don't show it); no-op otherwise. |
159 - (void)setDividerOpacity:(CGFloat)opacity; | 159 - (void)setDividerOpacity:(CGFloat)opacity; |
160 | 160 |
161 // Create and add the Browser Action buttons to the toolbar view. | 161 // Create and add the Browser Action buttons to the toolbar view. |
162 - (void)createBrowserActionButtons; | 162 - (void)createBrowserActionButtons; |
163 | 163 |
164 // Return the BrowserActionsController for this toolbar. | 164 // Return the BrowserActionsController for this toolbar. |
165 - (BrowserActionsController*)browserActionsController; | 165 - (BrowserActionsController*)browserActionsController; |
166 @end | 166 @end |
167 | 167 |
168 // A set of private methods used by tests, in the absence of "friends" in ObjC. | 168 // A set of private methods used by tests, in the absence of "friends" in ObjC. |
169 @interface ToolbarController(PrivateTestMethods) | 169 @interface ToolbarController(PrivateTestMethods) |
170 // Returns an array of views in the order of the outlets above. | 170 // Returns an array of views in the order of the outlets above. |
171 - (NSArray*)toolbarViews; | 171 - (NSArray*)toolbarViews; |
172 - (void)showOptionalHomeButton; | 172 - (void)showOptionalHomeButton; |
173 - (void)showOptionalPageWrenchButtons; | 173 - (void)showOptionalPageWrenchButtons; |
174 - (gfx::Rect)locationStackBounds; | 174 - (gfx::Rect)locationStackBounds; |
175 // Return a hover button for the current event. | 175 // Return a hover button for the current event. |
176 - (NSButton*)hoverButtonForEvent:(NSEvent*)theEvent; | 176 - (NSButton*)hoverButtonForEvent:(NSEvent*)theEvent; |
177 @end | 177 @end |
178 | 178 |
179 #endif // CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ | 179 #endif // CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ |
OLD | NEW |