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_BROWSER_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 // A class acting as the Objective-C controller for the Browser | 8 // A class acting as the Objective-C controller for the Browser |
9 // object. Handles interactions between Cocoa and the cross-platform | 9 // object. Handles interactions between Cocoa and the cross-platform |
10 // code. Each window has a single toolbar and, by virtue of being a | 10 // code. Each window has a single toolbar and, by virtue of being a |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 - (id)initWithBrowser:(Browser*)browser; | 96 - (id)initWithBrowser:(Browser*)browser; |
97 | 97 |
98 // Call to make the browser go away from other places in the cross-platform | 98 // Call to make the browser go away from other places in the cross-platform |
99 // code. | 99 // code. |
100 - (void)destroyBrowser; | 100 - (void)destroyBrowser; |
101 | 101 |
102 // Access the C++ bridge between the NSWindow and the rest of Chromium. | 102 // Access the C++ bridge between the NSWindow and the rest of Chromium. |
103 - (BrowserWindow*)browserWindow; | 103 - (BrowserWindow*)browserWindow; |
104 | 104 |
105 // Access the C++ bridge object representing the location bar. | 105 // Access the C++ bridge object representing the location bar. |
106 - (LocationBar*)locationBar; | 106 - (LocationBar*)locationBarBridge; |
107 | 107 |
108 // Access the C++ bridge object representing the status bubble for the window. | 108 // Access the C++ bridge object representing the status bubble for the window. |
109 - (StatusBubbleMac*)statusBubble; | 109 - (StatusBubbleMac*)statusBubble; |
110 | 110 |
111 // Updates the toolbar (and transitively the location bar) with the states of | 111 // Updates the toolbar (and transitively the location bar) with the states of |
112 // the specified |tab|. If |shouldRestore| is true, we're switching | 112 // the specified |tab|. If |shouldRestore| is true, we're switching |
113 // (back?) to this tab and should restore any previous location bar state | 113 // (back?) to this tab and should restore any previous location bar state |
114 // (such as user editing) as well. | 114 // (such as user editing) as well. |
115 - (void)updateToolbarWithContents:(TabContents*)tab | 115 - (void)updateToolbarWithContents:(TabContents*)tab |
116 shouldRestoreState:(BOOL)shouldRestore; | 116 shouldRestoreState:(BOOL)shouldRestore; |
117 | 117 |
118 // Sets whether or not the current page in the frontmost tab is bookmarked. | 118 // Sets whether or not the current page in the frontmost tab is bookmarked. |
119 - (void)setStarredState:(BOOL)isStarred; | 119 - (void)setStarredState:(BOOL)isStarred; |
120 | 120 |
121 // Return the rect, in WebKit coordinates (flipped), of the window's grow box | 121 // Return the rect, in WebKit coordinates (flipped), of the window's grow box |
122 // in the coordinate system of the content area of the currently selected tab. | 122 // in the coordinate system of the content area of the currently selected tab. |
123 - (NSRect)selectedTabGrowBoxRect; | 123 - (NSRect)selectedTabGrowBoxRect; |
124 | 124 |
125 // Called to tell the selected tab to update its loading state. | 125 // Called to tell the selected tab to update its loading state. |
126 - (void)setIsLoading:(BOOL)isLoading; | 126 - (void)setIsLoading:(BOOL)isLoading; |
127 | 127 |
128 // Brings this controller's window to the front. | 128 // Brings this controller's window to the front. |
129 - (void)activate; | 129 - (void)activate; |
130 | 130 |
131 // Make the location bar the first responder, if possible. | 131 // Make the location bar the first responder, if possible. |
132 - (void)focusLocationBar; | 132 - (void)focusLocationBar; |
133 | 133 |
| 134 // Determines whether this controller's window supports a given feature (i.e., |
| 135 // whether a given feature is or can be shown in the window). |
| 136 // TODO(viettrungluu): |feature| is really should be |Browser::Feature|, but I |
| 137 // don't want to include browser.h (and you can't forward declare enums). |
| 138 - (BOOL)supportsWindowFeature:(int)feature; |
| 139 |
| 140 // Called to check whether or not this window has a normal title bar (YES if it |
| 141 // does, NO otherwise). (E.g., normal browser windows do not, pop-ups do.) |
| 142 - (BOOL)hasTitleBar; |
| 143 |
| 144 // Called to check whether or not this window has a toolbar (YES if it does, NO |
| 145 // otherwise). (E.g., normal browser windows do, pop-ups do not.) |
| 146 - (BOOL)hasToolbar; |
| 147 |
| 148 // Called to check whether or not this window has a location bar (YES if it |
| 149 // does, NO otherwise). (E.g., normal browser windows do, pop-ups may or may |
| 150 // not.) |
| 151 - (BOOL)hasLocationBar; |
| 152 |
| 153 // Called to check whether or not this window can have bookmark bar (YES if it |
| 154 // does, NO otherwise). (E.g., normal browser windows may, pop-ups may not.) |
| 155 - (BOOL)supportsBookmarkBar; |
| 156 |
| 157 // Called to check if this controller's window is a normal window (e.g., not a |
| 158 // pop-up window). Returns YES if it is, NO otherwise. |
| 159 - (BOOL)isNormalWindow; |
| 160 |
134 - (BOOL)isBookmarkBarVisible; | 161 - (BOOL)isBookmarkBarVisible; |
135 | 162 |
136 // Called after bookmark bar visibility changes (due to pref change or change in | 163 // Called after bookmark bar visibility changes (due to pref change or change in |
137 // tab/tab contents). | 164 // tab/tab contents). |
138 - (void)updateBookmarkBarVisibilityWithAnimation:(BOOL)animate; | 165 - (void)updateBookmarkBarVisibilityWithAnimation:(BOOL)animate; |
139 | 166 |
140 - (BOOL)isDownloadShelfVisible; | 167 - (BOOL)isDownloadShelfVisible; |
141 | 168 |
142 // Lazily creates the download shelf in visible state if it doesn't exist yet. | 169 // Lazily creates the download shelf in visible state if it doesn't exist yet. |
143 - (DownloadShelfController*)downloadShelf; | 170 - (DownloadShelfController*)downloadShelf; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // Return a weak pointer to the toolbar controller. | 247 // Return a weak pointer to the toolbar controller. |
221 - (ToolbarController*)toolbarController; | 248 - (ToolbarController*)toolbarController; |
222 | 249 |
223 // Resets any saved state about window growth (due to showing the bookmark bar | 250 // Resets any saved state about window growth (due to showing the bookmark bar |
224 // or the download shelf), so that future shrinking will occur from the bottom. | 251 // or the download shelf), so that future shrinking will occur from the bottom. |
225 - (void)resetWindowGrowthState; | 252 - (void)resetWindowGrowthState; |
226 | 253 |
227 @end // BrowserWindowController(TestingAPI) | 254 @end // BrowserWindowController(TestingAPI) |
228 | 255 |
229 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 256 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |