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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.h

Issue 501135: Revert 34998, more stabbing in the dark to find a perf regression - Mac: impl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years 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 | Annotate | Revision Log
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 #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 29 matching lines...) Expand all
40 class TabStripModelObserverBridge; 40 class TabStripModelObserverBridge;
41 @class TabStripView; 41 @class TabStripView;
42 @class ToolbarController; 42 @class ToolbarController;
43 @class TitlebarController; 43 @class TitlebarController;
44 44
45 @interface BrowserWindowController : 45 @interface BrowserWindowController :
46 TabWindowController<NSUserInterfaceValidations, 46 TabWindowController<NSUserInterfaceValidations,
47 BookmarkBarControllerDelegate, 47 BookmarkBarControllerDelegate,
48 BrowserCommandExecutor, 48 BrowserCommandExecutor,
49 ViewResizer, 49 ViewResizer,
50 GTMThemeDelegate> { 50 GTMThemeDelegate,
51 URLDropTargetWindowController> {
51 @private 52 @private
52 // The ordering of these members is important as it determines the order in 53 // The ordering of these members is important as it determines the order in
53 // which they are destroyed. |browser_| needs to be destroyed last as most of 54 // which they are destroyed. |browser_| needs to be destroyed last as most of
54 // the other objects hold weak references to it or things it owns 55 // the other objects hold weak references to it or things it owns
55 // (tab/toolbar/bookmark models, profiles, etc). 56 // (tab/toolbar/bookmark models, profiles, etc).
56 scoped_ptr<Browser> browser_; 57 scoped_ptr<Browser> browser_;
57 NSWindow* savedRegularWindow_; 58 NSWindow* savedRegularWindow_;
58 scoped_ptr<TabStripModelObserverBridge> tabObserver_; 59 scoped_ptr<TabStripModelObserverBridge> tabObserver_;
59 scoped_ptr<BrowserWindowCocoa> windowShim_; 60 scoped_ptr<BrowserWindowCocoa> windowShim_;
60 scoped_nsobject<ToolbarController> toolbarController_; 61 scoped_nsobject<ToolbarController> toolbarController_;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // Called to check if this controller's window is a normal window (e.g., not a 157 // Called to check if this controller's window is a normal window (e.g., not a
157 // pop-up window). Returns YES if it is, NO otherwise. 158 // pop-up window). Returns YES if it is, NO otherwise.
158 - (BOOL)isNormalWindow; 159 - (BOOL)isNormalWindow;
159 160
160 - (BOOL)isBookmarkBarVisible; 161 - (BOOL)isBookmarkBarVisible;
161 162
162 // 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
163 // tab/tab contents). 164 // tab/tab contents).
164 - (void)updateBookmarkBarVisibilityWithAnimation:(BOOL)animate; 165 - (void)updateBookmarkBarVisibilityWithAnimation:(BOOL)animate;
165 166
166 // Return a weak pointer to the tab strip controller.
167 - (TabStripController*)tabStripController;
168
169 // Return a weak pointer to the toolbar controller.
170 - (ToolbarController*)toolbarController;
171
172 - (BOOL)isDownloadShelfVisible; 167 - (BOOL)isDownloadShelfVisible;
173 168
174 // 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.
175 - (DownloadShelfController*)downloadShelf; 170 - (DownloadShelfController*)downloadShelf;
176 171
177 // Retains the given FindBarCocoaController and adds its view to this 172 // Retains the given FindBarCocoaController and adds its view to this
178 // browser window. Must only be called once per 173 // browser window. Must only be called once per
179 // BrowserWindowController. 174 // BrowserWindowController.
180 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController; 175 - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController;
181 176
(...skipping 26 matching lines...) Expand all
208 // Returns YES if the window became the active per-tab sheet of the current tab, 203 // Returns YES if the window became the active per-tab sheet of the current tab,
209 // or NO if the current tab already has a per-tab sheet. If this returns NO, 204 // or NO if the current tab already has a per-tab sheet. If this returns NO,
210 // the window's |Realize()| method will be called again when the curren sheet 205 // the window's |Realize()| method will be called again when the curren sheet
211 // disappears. The window should then call |attachConstrainedWindow:| again. 206 // disappears. The window should then call |attachConstrainedWindow:| again.
212 - (BOOL)attachConstrainedWindow:(ConstrainedWindowMac*)window; 207 - (BOOL)attachConstrainedWindow:(ConstrainedWindowMac*)window;
213 208
214 // Closes the tab sheet |window| and potentially shows the next sheet in the 209 // Closes the tab sheet |window| and potentially shows the next sheet in the
215 // tab's sheet queue. 210 // tab's sheet queue.
216 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; 211 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window;
217 212
213 // Implementation of the |URLDropTargetWindowController| protocol, which is
214 // needed for URL dropping on the tab strip.
215 - (void)dropURLs:(NSArray*)urls at:(NSPoint)location;
216 - (void)indicateDropURLsAt:(NSPoint)location;
217 - (void)hideDropURLsIndicator;
218
218 @end 219 @end
219 220
220 // Methods which are either only for testing, or only public for testing. 221 // Methods which are either only for testing, or only public for testing.
221 @interface BrowserWindowController(TestingAPI) 222 @interface BrowserWindowController(TestingAPI)
222 223
223 // Put the incognito badge on the browser and adjust the tab strip 224 // Put the incognito badge on the browser and adjust the tab strip
224 // accordingly. 225 // accordingly.
225 - (void)installIncognitoBadge; 226 - (void)installIncognitoBadge;
226 227
227 // Allows us to initWithBrowser withOUT taking ownership of the browser. 228 // Allows us to initWithBrowser withOUT taking ownership of the browser.
228 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt; 229 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt;
229 230
230 // Adjusts the window height by the given amount. If the window spans from the 231 // Adjusts the window height by the given amount. If the window spans from the
231 // top of the current workspace to the bottom of the current workspace, the 232 // top of the current workspace to the bottom of the current workspace, the
232 // height is not adjusted. If growing the window by the requested amount would 233 // height is not adjusted. If growing the window by the requested amount would
233 // size the window to be taller than the current workspace, the window height is 234 // size the window to be taller than the current workspace, the window height is
234 // capped to be equal to the height of the current workspace. If the window is 235 // capped to be equal to the height of the current workspace. If the window is
235 // partially offscreen, its height is not adjusted at all. This function 236 // partially offscreen, its height is not adjusted at all. This function
236 // prefers to grow the window down, but will grow up if needed. Calls to this 237 // prefers to grow the window down, but will grow up if needed. Calls to this
237 // function should be followed by a call to |layoutSubviews|. 238 // function should be followed by a call to |layoutSubviews|.
238 - (void)adjustWindowHeightBy:(CGFloat)deltaH; 239 - (void)adjustWindowHeightBy:(CGFloat)deltaH;
239 240
240 // Return an autoreleased NSWindow suitable for fullscreen use. 241 // Return an autoreleased NSWindow suitable for fullscreen use.
241 - (NSWindow*)fullscreenWindow; 242 - (NSWindow*)fullscreenWindow;
242 243
243 // Return a point suitable for the topLeft for a bookmark bubble. 244 // Return a point suitable for the topLeft for a bookmark bubble.
244 - (NSPoint)topLeftForBubble; 245 - (NSPoint)topLeftForBubble;
245 246
247 // Return a weak pointer to the toolbar controller.
248 - (ToolbarController*)toolbarController;
249
246 // 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
247 // 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.
248 - (void)resetWindowGrowthState; 252 - (void)resetWindowGrowthState;
249 253
250 @end // BrowserWindowController(TestingAPI) 254 @end // BrowserWindowController(TestingAPI)
251 255
252 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 256 #endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_editor.mm ('k') | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698