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

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

Issue 11876036: Alternate NTP: Don't hide bookmark bar on instant (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests actually pass! Created 7 years, 11 months 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) 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_BROWSER_WINDOW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // The view controller that manages the incognito badge or the multi-profile 107 // The view controller that manages the incognito badge or the multi-profile
108 // avatar icon. The view is always in the view hierarchy, but will be hidden 108 // avatar icon. The view is always in the view hierarchy, but will be hidden
109 // unless it's appropriate to show it. 109 // unless it's appropriate to show it.
110 scoped_nsobject<AvatarButtonController> avatarButtonController_; 110 scoped_nsobject<AvatarButtonController> avatarButtonController_;
111 111
112 // Lazily created view which draws the background for the floating set of bars 112 // Lazily created view which draws the background for the floating set of bars
113 // in presentation mode (for window types having a floating bar; it remains 113 // in presentation mode (for window types having a floating bar; it remains
114 // nil for those which don't). 114 // nil for those which don't).
115 scoped_nsobject<NSView> floatingBarBackingView_; 115 scoped_nsobject<NSView> floatingBarBackingView_;
116 116
117 // Tracks whether the floating bar is above or below the bookmark bar, in
118 // terms of z-order.
119 BOOL floatingBarAboveBookmarkBar_;
120
121 // The borderless window used in fullscreen mode. Lion reuses the original 117 // The borderless window used in fullscreen mode. Lion reuses the original
122 // window in fullscreen mode, so this is always nil on Lion. 118 // window in fullscreen mode, so this is always nil on Lion.
123 scoped_nsobject<NSWindow> fullscreenWindow_; 119 scoped_nsobject<NSWindow> fullscreenWindow_;
124 120
125 // Tracks whether presentation mode was entered from fullscreen mode or 121 // Tracks whether presentation mode was entered from fullscreen mode or
126 // directly from normal windowed mode. Used to determine what to do when 122 // directly from normal windowed mode. Used to determine what to do when
127 // exiting presentation mode. 123 // exiting presentation mode.
128 BOOL enteredPresentationModeFromFullscreen_; 124 BOOL enteredPresentationModeFromFullscreen_;
129 125
130 // True between -windowWillEnterFullScreen and -windowDidEnterFullScreen. 126 // True between -windowWillEnterFullScreen and -windowDidEnterFullScreen.
(...skipping 25 matching lines...) Expand all
156 152
157 // When going fullscreen for a tab, we need to store the URL and the 153 // When going fullscreen for a tab, we need to store the URL and the
158 // fullscreen type, since we can't show the bubble until 154 // fullscreen type, since we can't show the bubble until
159 // -windowDidEnterFullScreen: gets called. 155 // -windowDidEnterFullScreen: gets called.
160 GURL fullscreenUrl_; 156 GURL fullscreenUrl_;
161 FullscreenExitBubbleType fullscreenBubbleType_; 157 FullscreenExitBubbleType fullscreenBubbleType_;
162 158
163 // The Extension Command Registry used to determine which keyboard events to 159 // The Extension Command Registry used to determine which keyboard events to
164 // handle. 160 // handle.
165 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; 161 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_;
162
163 // The offset between the bottom of the toolbar and web contents. This is used
164 // to push the web contents below the bookmark bar.
165 CGFloat toolbarToWebContentsOffset_;
166 } 166 }
167 167
168 // A convenience class method which gets the |BrowserWindowController| for a 168 // A convenience class method which gets the |BrowserWindowController| for a
169 // given window. This method returns nil if no window in the chain has a BWC. 169 // given window. This method returns nil if no window in the chain has a BWC.
170 + (BrowserWindowController*)browserWindowControllerForWindow:(NSWindow*)window; 170 + (BrowserWindowController*)browserWindowControllerForWindow:(NSWindow*)window;
171 171
172 // A convenience class method which gets the |BrowserWindowController| for a 172 // A convenience class method which gets the |BrowserWindowController| for a
173 // given view. This is the controller for the window containing |view|, if it 173 // given view. This is the controller for the window containing |view|, if it
174 // is a BWC, or the first controller in the parent-window chain that is a 174 // is a BWC, or the first controller in the parent-window chain that is a
175 // BWC. This method returns nil if no window in the chain has a BWC. 175 // BWC. This method returns nil if no window in the chain has a BWC.
(...skipping 12 matching lines...) Expand all
188 188
189 // Access the C++ bridge between the NSWindow and the rest of Chromium. 189 // Access the C++ bridge between the NSWindow and the rest of Chromium.
190 - (BrowserWindow*)browserWindow; 190 - (BrowserWindow*)browserWindow;
191 191
192 // Return a weak pointer to the toolbar controller. 192 // Return a weak pointer to the toolbar controller.
193 - (ToolbarController*)toolbarController; 193 - (ToolbarController*)toolbarController;
194 194
195 // Return a weak pointer to the tab strip controller. 195 // Return a weak pointer to the tab strip controller.
196 - (TabStripController*)tabStripController; 196 - (TabStripController*)tabStripController;
197 197
198 // Return a weak pointer to the find bar controller.
199 - (FindBarCocoaController*)findBarCocoaController;
200
198 // Access the ObjC controller that contains the infobars. 201 // Access the ObjC controller that contains the infobars.
199 - (InfoBarContainerController*)infoBarContainerController; 202 - (InfoBarContainerController*)infoBarContainerController;
200 203
201 // Access the C++ bridge object representing the status bubble for the window. 204 // Access the C++ bridge object representing the status bubble for the window.
202 - (StatusBubbleMac*)statusBubble; 205 - (StatusBubbleMac*)statusBubble;
203 206
204 // Access the C++ bridge object representing the location bar. 207 // Access the C++ bridge object representing the location bar.
205 - (LocationBarViewMac*)locationBarBridge; 208 - (LocationBarViewMac*)locationBarBridge;
206 209
210 // Returns a weak pointer to the floating bar backing view;
211 - (NSView*)floatingBarBackingView;
212
213 // Returns a weak pointer to the previewable contents controller.
214 - (PreviewableContentsController*)previewableContentsController;
215
207 // Access the Profile object that backs this Browser. 216 // Access the Profile object that backs this Browser.
208 - (Profile*)profile; 217 - (Profile*)profile;
209 218
210 // Access the avatar button controller. 219 // Access the avatar button controller.
211 - (AvatarButtonController*)avatarButtonController; 220 - (AvatarButtonController*)avatarButtonController;
212 221
213 // Updates the toolbar (and transitively the location bar) with the states of 222 // Updates the toolbar (and transitively the location bar) with the states of
214 // the specified |tab|. If |shouldRestore| is true, we're switching 223 // the specified |tab|. If |shouldRestore| is true, we're switching
215 // (back?) to this tab and should restore any previous location bar state 224 // (back?) to this tab and should restore any previous location bar state
216 // (such as user editing) as well. 225 // (such as user editing) as well.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // Returns the frame, in Cocoa (unflipped) screen coordinates, of the area where 327 // Returns the frame, in Cocoa (unflipped) screen coordinates, of the area where
319 // Instant results are. If Instant is not showing, returns the frame of where 328 // Instant results are. If Instant is not showing, returns the frame of where
320 // it would be. 329 // it would be.
321 - (NSRect)instantFrame; 330 - (NSRect)instantFrame;
322 331
323 // Called when the Add Search Engine dialog is closed. 332 // Called when the Add Search Engine dialog is closed.
324 - (void)sheetDidEnd:(NSWindow*)sheet 333 - (void)sheetDidEnd:(NSWindow*)sheet
325 returnCode:(NSInteger)code 334 returnCode:(NSInteger)code
326 context:(void*)context; 335 context:(void*)context;
327 336
337 - (void)updateBookmarkBarStateForInstantPreview;
338
328 @end // @interface BrowserWindowController 339 @end // @interface BrowserWindowController
329 340
330 341
331 // Methods having to do with the window type (normal/popup/app, and whether the 342 // Methods having to do with the window type (normal/popup/app, and whether the
332 // window has various features; fullscreen and presentation mode methods are 343 // window has various features; fullscreen and presentation mode methods are
333 // separate). 344 // separate).
334 @interface BrowserWindowController(WindowType) 345 @interface BrowserWindowController(WindowType)
335 346
336 // Determines whether this controller's window supports a given feature (i.e., 347 // Determines whether this controller's window supports a given feature (i.e.,
337 // whether a given feature is or can be shown in the window). 348 // whether a given feature is or can be shown in the window).
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 // |source| rect doesn't fit into |target|. 477 // |source| rect doesn't fit into |target|.
467 - (NSSize)overflowFrom:(NSRect)source 478 - (NSSize)overflowFrom:(NSRect)source
468 to:(NSRect)target; 479 to:(NSRect)target;
469 480
470 // The fullscreen exit bubble controller, or nil if the bubble isn't showing. 481 // The fullscreen exit bubble controller, or nil if the bubble isn't showing.
471 - (FullscreenExitBubbleController*)fullscreenExitBubbleController; 482 - (FullscreenExitBubbleController*)fullscreenExitBubbleController;
472 @end // @interface BrowserWindowController (TestingAPI) 483 @end // @interface BrowserWindowController (TestingAPI)
473 484
474 485
475 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 486 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698