| OLD | NEW |
| 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 |
| 11 // TabWindowController, a tab strip along the top. | 11 // TabWindowController, a tab strip along the top. |
| 12 | 12 |
| 13 #import <Cocoa/Cocoa.h> | 13 #import <Cocoa/Cocoa.h> |
| 14 | 14 |
| 15 #include "base/mac/scoped_nsobject.h" | 15 #include "base/mac/scoped_nsobject.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" | 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" |
| 19 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | 19 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
| 20 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" | 20 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" |
| 21 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 21 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 22 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 22 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
| 23 #import "chrome/browser/ui/cocoa/themed_window.h" | 23 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 24 #import "chrome/browser/ui/cocoa/url_drop_target.h" | 24 #import "chrome/browser/ui/cocoa/url_drop_target.h" |
| 25 #import "chrome/browser/ui/cocoa/view_resizer.h" | 25 #import "chrome/browser/ui/cocoa/view_resizer.h" |
| 26 #include "ui/gfx/rect.h" | 26 #include "ui/gfx/rect.h" |
| 27 | 27 |
| 28 @class AvatarButtonController; | 28 @class AvatarBaseController; |
| 29 class Browser; | 29 class Browser; |
| 30 class BrowserWindow; | 30 class BrowserWindow; |
| 31 class BrowserWindowCocoa; | 31 class BrowserWindowCocoa; |
| 32 @class DevToolsController; | 32 @class DevToolsController; |
| 33 @class DownloadShelfController; | 33 @class DownloadShelfController; |
| 34 class ExtensionKeybindingRegistryCocoa; | 34 class ExtensionKeybindingRegistryCocoa; |
| 35 @class FindBarCocoaController; | 35 @class FindBarCocoaController; |
| 36 @class FullscreenModeController; | 36 @class FullscreenModeController; |
| 37 @class FullscreenWindow; | 37 @class FullscreenWindow; |
| 38 @class InfoBarContainerController; | 38 @class InfoBarContainerController; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // restrict the amount of shrinking by the amounts specified above. Reset to | 97 // restrict the amount of shrinking by the amounts specified above. Reset to |
| 98 // NO on growth. | 98 // NO on growth. |
| 99 BOOL isShrinkingFromZoomed_; | 99 BOOL isShrinkingFromZoomed_; |
| 100 | 100 |
| 101 // The raw accumulated zoom value and the actual zoom increments made for an | 101 // The raw accumulated zoom value and the actual zoom increments made for an |
| 102 // an in-progress pinch gesture. | 102 // an in-progress pinch gesture. |
| 103 CGFloat totalMagnifyGestureAmount_; | 103 CGFloat totalMagnifyGestureAmount_; |
| 104 NSInteger currentZoomStepDelta_; | 104 NSInteger currentZoomStepDelta_; |
| 105 | 105 |
| 106 // The view controller that manages the incognito badge or the multi-profile | 106 // The view controller that manages the incognito badge or the multi-profile |
| 107 // avatar icon. The view is always in the view hierarchy, but will be hidden | 107 // avatar button. Depending on whether the --new-profile-management flag is |
| 108 // unless it's appropriate to show it. | 108 // used, the multi-profile button can either be the avatar's icon badge or a |
| 109 base::scoped_nsobject<AvatarButtonController> avatarButtonController_; | 109 // button with the profile's name. If the flag is used, the button is always |
| 110 // shown, otherwise the view will always be in the view hierarchy but will |
| 111 // be hidden unless it's appropriate to show it (i.e. if there's more than |
| 112 // one profile). |
| 113 base::scoped_nsobject<AvatarBaseController> avatarButtonController_; |
| 110 | 114 |
| 111 // Lazily created view which draws the background for the floating set of bars | 115 // Lazily created view which draws the background for the floating set of bars |
| 112 // in presentation mode (for window types having a floating bar; it remains | 116 // in presentation mode (for window types having a floating bar; it remains |
| 113 // nil for those which don't). | 117 // nil for those which don't). |
| 114 base::scoped_nsobject<NSView> floatingBarBackingView_; | 118 base::scoped_nsobject<NSView> floatingBarBackingView_; |
| 115 | 119 |
| 116 // The borderless window used in fullscreen mode. Lion reuses the original | 120 // The borderless window used in fullscreen mode. Lion reuses the original |
| 117 // window in fullscreen mode, so this is always nil on Lion. | 121 // window in fullscreen mode, so this is always nil on Lion. |
| 118 base::scoped_nsobject<NSWindow> fullscreenWindow_; | 122 base::scoped_nsobject<NSWindow> fullscreenWindow_; |
| 119 | 123 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // Returns a weak pointer to the floating bar backing view; | 219 // Returns a weak pointer to the floating bar backing view; |
| 216 - (NSView*)floatingBarBackingView; | 220 - (NSView*)floatingBarBackingView; |
| 217 | 221 |
| 218 // Returns a weak pointer to the overlayable contents controller. | 222 // Returns a weak pointer to the overlayable contents controller. |
| 219 - (OverlayableContentsController*)overlayableContentsController; | 223 - (OverlayableContentsController*)overlayableContentsController; |
| 220 | 224 |
| 221 // Access the Profile object that backs this Browser. | 225 // Access the Profile object that backs this Browser. |
| 222 - (Profile*)profile; | 226 - (Profile*)profile; |
| 223 | 227 |
| 224 // Access the avatar button controller. | 228 // Access the avatar button controller. |
| 225 - (AvatarButtonController*)avatarButtonController; | 229 - (AvatarBaseController*)avatarButtonController; |
| 226 | 230 |
| 227 // Forces the toolbar (and transitively the location bar) to update its current | 231 // Forces the toolbar (and transitively the location bar) to update its current |
| 228 // state. If |tab| is non-NULL, we're switching (back?) to this tab and should | 232 // state. If |tab| is non-NULL, we're switching (back?) to this tab and should |
| 229 // restore any previous location bar state (such as user editing) as well. | 233 // restore any previous location bar state (such as user editing) as well. |
| 230 - (void)updateToolbarWithContents:(content::WebContents*)tab; | 234 - (void)updateToolbarWithContents:(content::WebContents*)tab; |
| 231 | 235 |
| 232 // Sets whether or not the current page in the frontmost tab is bookmarked. | 236 // Sets whether or not the current page in the frontmost tab is bookmarked. |
| 233 - (void)setStarredState:(BOOL)isStarred; | 237 - (void)setStarredState:(BOOL)isStarred; |
| 234 | 238 |
| 235 // Happens when the zoom level is changed in the active tab, the active tab is | 239 // Happens when the zoom level is changed in the active tab, the active tab is |
| (...skipping 21 matching lines...) Expand all Loading... |
| 257 | 261 |
| 258 // Returns the frame of the regular (non-fullscreened) window (even if the | 262 // Returns the frame of the regular (non-fullscreened) window (even if the |
| 259 // window is currently in fullscreen mode). The frame is returned in Cocoa | 263 // window is currently in fullscreen mode). The frame is returned in Cocoa |
| 260 // coordinates (origin in bottom-left). | 264 // coordinates (origin in bottom-left). |
| 261 - (NSRect)regularWindowFrame; | 265 - (NSRect)regularWindowFrame; |
| 262 | 266 |
| 263 // Whether or not to show the avatar, which is either the incognito guy or the | 267 // Whether or not to show the avatar, which is either the incognito guy or the |
| 264 // user's profile avatar. | 268 // user's profile avatar. |
| 265 - (BOOL)shouldShowAvatar; | 269 - (BOOL)shouldShowAvatar; |
| 266 | 270 |
| 271 // Whether or not to show the new avatar button used by --new-profile-maagement. |
| 272 - (BOOL)shouldUseNewAvatarButton; |
| 273 |
| 267 - (BOOL)isBookmarkBarVisible; | 274 - (BOOL)isBookmarkBarVisible; |
| 268 | 275 |
| 269 // Returns YES if the bookmark bar is currently animating. | 276 // Returns YES if the bookmark bar is currently animating. |
| 270 - (BOOL)isBookmarkBarAnimating; | 277 - (BOOL)isBookmarkBarAnimating; |
| 271 | 278 |
| 272 - (BookmarkBarController*)bookmarkBarController; | 279 - (BookmarkBarController*)bookmarkBarController; |
| 273 | 280 |
| 274 - (DevToolsController*)devToolsController; | 281 - (DevToolsController*)devToolsController; |
| 275 | 282 |
| 276 - (BOOL)isDownloadShelfVisible; | 283 - (BOOL)isDownloadShelfVisible; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 // positioned relative to. | 503 // positioned relative to. |
| 497 - (NSRect)omniboxPopupAnchorRect; | 504 - (NSRect)omniboxPopupAnchorRect; |
| 498 | 505 |
| 499 // Force a layout of info bars. | 506 // Force a layout of info bars. |
| 500 - (void)layoutInfoBars; | 507 - (void)layoutInfoBars; |
| 501 | 508 |
| 502 @end // @interface BrowserWindowController (TestingAPI) | 509 @end // @interface BrowserWindowController (TestingAPI) |
| 503 | 510 |
| 504 | 511 |
| 505 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 512 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| OLD | NEW |