| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 scoped_ptr<LocationBarViewMac> locationBarView_; | 47 scoped_ptr<LocationBarViewMac> locationBarView_; |
| 48 scoped_nsobject<LocationBarFieldEditor> locationBarFieldEditor_; // strong | 48 scoped_nsobject<LocationBarFieldEditor> locationBarFieldEditor_; // strong |
| 49 scoped_nsobject<BookmarkBarController> bookmarkBarController_; | 49 scoped_nsobject<BookmarkBarController> bookmarkBarController_; |
| 50 id<BookmarkURLOpener> bookmarkBarDelegate_; // weak | 50 id<BookmarkURLOpener> bookmarkBarDelegate_; // weak |
| 51 NSView* webContentView_; // weak; where the web goes | 51 NSView* webContentView_; // weak; where the web goes |
| 52 | 52 |
| 53 // Used for monitoring the optional toolbar button prefs. | 53 // Used for monitoring the optional toolbar button prefs. |
| 54 scoped_ptr<ToolbarControllerInternal::PrefObserverBridge> prefObserver_; | 54 scoped_ptr<ToolbarControllerInternal::PrefObserverBridge> prefObserver_; |
| 55 BooleanPrefMember showHomeButton_; | 55 BooleanPrefMember showHomeButton_; |
| 56 BooleanPrefMember showPageOptionButtons_; | 56 BooleanPrefMember showPageOptionButtons_; |
| 57 BOOL hasToolbar_; // if NO, we only have the location bar. |
| 57 | 58 |
| 58 IBOutlet NSMenu* pageMenu_; | 59 IBOutlet NSMenu* pageMenu_; |
| 59 IBOutlet NSMenu* wrenchMenu_; | 60 IBOutlet NSMenu* wrenchMenu_; |
| 60 | 61 |
| 61 // The ordering is important for unit tests. If new items are added or the | 62 // The ordering is important for unit tests. If new items are added or the |
| 62 // ordering is changed, make sure to update |-toolbarViews| and the | 63 // ordering is changed, make sure to update |-toolbarViews| and the |
| 63 // corresponding enum in the unit tests. | 64 // corresponding enum in the unit tests. |
| 64 IBOutlet NSButton* backButton_; | 65 IBOutlet NSButton* backButton_; |
| 65 IBOutlet NSButton* forwardButton_; | 66 IBOutlet NSButton* forwardButton_; |
| 66 IBOutlet NSButton* reloadButton_; | 67 IBOutlet NSButton* reloadButton_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 - (void)updateToolbarWithContents:(TabContents*)tabForRestoring | 100 - (void)updateToolbarWithContents:(TabContents*)tabForRestoring |
| 100 shouldRestoreState:(BOOL)shouldRestore; | 101 shouldRestoreState:(BOOL)shouldRestore; |
| 101 | 102 |
| 102 // Sets whether or not the current page in the frontmost tab is bookmarked. | 103 // Sets whether or not the current page in the frontmost tab is bookmarked. |
| 103 - (void)setStarredState:(BOOL)isStarred; | 104 - (void)setStarredState:(BOOL)isStarred; |
| 104 | 105 |
| 105 // Called to update the loading state. Handles updating the go/stop button | 106 // Called to update the loading state. Handles updating the go/stop button |
| 106 // state. | 107 // state. |
| 107 - (void)setIsLoading:(BOOL)isLoading; | 108 - (void)setIsLoading:(BOOL)isLoading; |
| 108 | 109 |
| 110 // Allow turning off the toolbar (but we keep the location bar |
| 111 // around). This changes the behavior of other methods, like |
| 112 // [self view]. |
| 113 - (void)setHasToolbar:(BOOL)toolbar; |
| 114 |
| 109 // Return the bookmark bar controller. | 115 // Return the bookmark bar controller. |
| 110 - (BookmarkBarController*)bookmarkBarController; | 116 - (BookmarkBarController*)bookmarkBarController; |
| 111 | 117 |
| 112 // Actions for the optional menu buttons for the page and wrench menus. These | 118 // Actions for the optional menu buttons for the page and wrench menus. These |
| 113 // will show a menu while the mouse is down. | 119 // will show a menu while the mouse is down. |
| 114 - (IBAction)showPageMenu:(id)sender; | 120 - (IBAction)showPageMenu:(id)sender; |
| 115 - (IBAction)showWrenchMenu:(id)sender; | 121 - (IBAction)showWrenchMenu:(id)sender; |
| 116 | 122 |
| 117 @end | 123 @end |
| 118 | 124 |
| 119 // A set of private methods used by tests, in the absence of "friends" in ObjC. | 125 // A set of private methods used by tests, in the absence of "friends" in ObjC. |
| 120 @interface ToolbarController(PrivateTestMethods) | 126 @interface ToolbarController(PrivateTestMethods) |
| 121 // Returns an array of views in the order of the outlets above. | 127 // Returns an array of views in the order of the outlets above. |
| 122 - (NSArray*)toolbarViews; | 128 - (NSArray*)toolbarViews; |
| 123 - (void)showOptionalHomeButton; | 129 - (void)showOptionalHomeButton; |
| 124 - (void)showOptionalPageWrenchButtons; | 130 - (void)showOptionalPageWrenchButtons; |
| 125 @end | 131 @end |
| 126 | 132 |
| 127 #endif // CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ | 133 #endif // CHROME_BROWSER_COCOA_TOOLBAR_CONTROLLER_H_ |
| OLD | NEW |