Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // A class acting as the Objective-C controller for the Browser | 9 // A class acting as the Objective-C controller for the Browser |
| 10 // object. Handles interactions between Cocoa and the cross-platform | 10 // object. Handles interactions between Cocoa and the cross-platform |
| 11 // code. Each window has a single toolbar and, by virtue of being a | 11 // code. Each window has a single toolbar and, by virtue of being a |
| 12 // TabWindowController, a tab strip along the top. | 12 // TabWindowController, a tab strip along the top. |
| 13 | 13 |
| 14 #import <Cocoa/Cocoa.h> | 14 #import <Cocoa/Cocoa.h> |
| 15 | 15 |
| 16 #include "base/memory/scoped_nsobject.h" | 16 #include "base/memory/scoped_nsobject.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "chrome/browser/sync/sync_ui_util.h" | 18 #include "chrome/browser/sync/sync_ui_util.h" |
| 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" | 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" |
| 21 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | 21 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
| 22 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" | |
| 22 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" | 23 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" |
| 23 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 24 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 24 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 25 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
| 25 #import "chrome/browser/ui/cocoa/themed_window.h" | 26 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 26 #import "chrome/browser/ui/cocoa/url_drop_target.h" | 27 #import "chrome/browser/ui/cocoa/url_drop_target.h" |
| 27 #import "chrome/browser/ui/cocoa/view_resizer.h" | 28 #import "chrome/browser/ui/cocoa/view_resizer.h" |
| 28 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
| 29 | 30 |
| 30 @class AvatarButton; | 31 @class AvatarButton; |
| 31 class Browser; | 32 class Browser; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 scoped_nsobject<ToolbarController> toolbarController_; | 67 scoped_nsobject<ToolbarController> toolbarController_; |
| 67 scoped_nsobject<TabStripController> tabStripController_; | 68 scoped_nsobject<TabStripController> tabStripController_; |
| 68 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; | 69 scoped_nsobject<FindBarCocoaController> findBarCocoaController_; |
| 69 scoped_nsobject<InfoBarContainerController> infoBarContainerController_; | 70 scoped_nsobject<InfoBarContainerController> infoBarContainerController_; |
| 70 scoped_nsobject<DownloadShelfController> downloadShelfController_; | 71 scoped_nsobject<DownloadShelfController> downloadShelfController_; |
| 71 scoped_nsobject<BookmarkBarController> bookmarkBarController_; | 72 scoped_nsobject<BookmarkBarController> bookmarkBarController_; |
| 72 scoped_nsobject<DevToolsController> devToolsController_; | 73 scoped_nsobject<DevToolsController> devToolsController_; |
| 73 scoped_nsobject<SidebarController> sidebarController_; | 74 scoped_nsobject<SidebarController> sidebarController_; |
| 74 scoped_nsobject<PreviewableContentsController> previewableContentsController_; | 75 scoped_nsobject<PreviewableContentsController> previewableContentsController_; |
| 75 scoped_nsobject<PresentationModeController> presentationModeController_; | 76 scoped_nsobject<PresentationModeController> presentationModeController_; |
| 77 scoped_nsobject<FullscreenExitBubbleController> | |
| 78 fullscreenExitBubbleController_; | |
| 76 | 79 |
| 77 // Strong. StatusBubble is a special case of a strong reference that | 80 // Strong. StatusBubble is a special case of a strong reference that |
| 78 // we don't wrap in a scoped_ptr because it is acting the same | 81 // we don't wrap in a scoped_ptr because it is acting the same |
| 79 // as an NSWindowController in that it wraps a window that must | 82 // as an NSWindowController in that it wraps a window that must |
| 80 // be shut down before our destructors are called. | 83 // be shut down before our destructors are called. |
| 81 StatusBubbleMac* statusBubble_; | 84 StatusBubbleMac* statusBubble_; |
| 82 | 85 |
| 83 BookmarkBubbleController* bookmarkBubbleController_; // Weak. | 86 BookmarkBubbleController* bookmarkBubbleController_; // Weak. |
| 84 BOOL initializing_; // YES while we are currently in initWithBrowser: | 87 BOOL initializing_; // YES while we are currently in initWithBrowser: |
| 85 BOOL ownsBrowser_; // Only ever NO when testing | 88 BOOL ownsBrowser_; // Only ever NO when testing |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 114 | 117 |
| 115 // The view that shows the presentation mode toggle when in Lion fullscreen | 118 // The view that shows the presentation mode toggle when in Lion fullscreen |
| 116 // mode. Nil if not in fullscreen mode or not on Lion. | 119 // mode. Nil if not in fullscreen mode or not on Lion. |
| 117 scoped_nsobject<NSButton> presentationModeToggleButton_; | 120 scoped_nsobject<NSButton> presentationModeToggleButton_; |
| 118 | 121 |
| 119 // Lazily created view which draws the background for the floating set of bars | 122 // Lazily created view which draws the background for the floating set of bars |
| 120 // in presentation mode (for window types having a floating bar; it remains | 123 // in presentation mode (for window types having a floating bar; it remains |
| 121 // nil for those which don't). | 124 // nil for those which don't). |
| 122 scoped_nsobject<NSView> floatingBarBackingView_; | 125 scoped_nsobject<NSView> floatingBarBackingView_; |
| 123 | 126 |
| 127 BOOL showFloatingChrome_; | |
|
Nico
2011/09/15 04:37:32
Add a (redundant with the method comment) comment,
jeremya
2011/09/15 06:33:28
Done.
| |
| 128 | |
| 124 // Tracks whether the floating bar is above or below the bookmark bar, in | 129 // Tracks whether the floating bar is above or below the bookmark bar, in |
| 125 // terms of z-order. | 130 // terms of z-order. |
| 126 BOOL floatingBarAboveBookmarkBar_; | 131 BOOL floatingBarAboveBookmarkBar_; |
| 127 | 132 |
| 128 // The borderless window used in fullscreen mode. Lion reuses the original | 133 // The borderless window used in fullscreen mode. Lion reuses the original |
| 129 // window in fullscreen mode, so this is always nil on Lion. | 134 // window in fullscreen mode, so this is always nil on Lion. |
| 130 scoped_nsobject<NSWindow> fullscreenWindow_; | 135 scoped_nsobject<NSWindow> fullscreenWindow_; |
| 131 | 136 |
| 132 // Tracks whether presentation mode was entered from fullscreen mode or | 137 // Tracks whether presentation mode was entered from fullscreen mode or |
| 133 // directly from normal windowed mode. Used to determine what to do when | 138 // directly from normal windowed mode. Used to determine what to do when |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 // Resizes the fullscreen window to fit the screen it's currently on. Called by | 390 // Resizes the fullscreen window to fit the screen it's currently on. Called by |
| 386 // the PresentationModeController when there is a change in monitor placement or | 391 // the PresentationModeController when there is a change in monitor placement or |
| 387 // resolution. | 392 // resolution. |
| 388 - (void)resizeFullscreenWindow; | 393 - (void)resizeFullscreenWindow; |
| 389 | 394 |
| 390 // Gets or sets the fraction of the floating bar (presentation mode overlay) | 395 // Gets or sets the fraction of the floating bar (presentation mode overlay) |
| 391 // that is shown. 0 is completely hidden, 1 is fully shown. | 396 // that is shown. 0 is completely hidden, 1 is fully shown. |
| 392 - (CGFloat)floatingBarShownFraction; | 397 - (CGFloat)floatingBarShownFraction; |
| 393 - (void)setFloatingBarShownFraction:(CGFloat)fraction; | 398 - (void)setFloatingBarShownFraction:(CGFloat)fraction; |
| 394 | 399 |
| 400 // Sets whether to show the chrome that drops down from the top of the screen. | |
| 401 - (void)setShowFloatingChrome:(BOOL)showChrome; | |
| 402 | |
| 395 // Query/lock/release the requirement that the tab strip/toolbar/attached | 403 // Query/lock/release the requirement that the tab strip/toolbar/attached |
| 396 // bookmark bar bar cluster is visible (e.g., when one of its elements has | 404 // bookmark bar bar cluster is visible (e.g., when one of its elements has |
| 397 // focus). This is required for the floating bar in presentation mode, but | 405 // focus). This is required for the floating bar in presentation mode, but |
| 398 // should also be called when not in presentation mode; see the comments for | 406 // should also be called when not in presentation mode; see the comments for |
| 399 // |barVisibilityLocks_| for more details. Double locks/releases by the same | 407 // |barVisibilityLocks_| for more details. Double locks/releases by the same |
| 400 // owner are ignored. If |animate:| is YES, then an animation may be performed, | 408 // owner are ignored. If |animate:| is YES, then an animation may be performed, |
| 401 // possibly after a small delay if |delay:| is YES. If |animate:| is NO, | 409 // possibly after a small delay if |delay:| is YES. If |animate:| is NO, |
| 402 // |delay:| will be ignored. In the case of multiple calls, later calls have | 410 // |delay:| will be ignored. In the case of multiple calls, later calls have |
| 403 // precedence with the rule that |animate:NO| has precedence over |animate:YES|, | 411 // precedence with the rule that |animate:NO| has precedence over |animate:YES|, |
| 404 // and |delay:NO| has precedence over |delay:YES|. | 412 // and |delay:NO| has precedence over |delay:YES|. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 447 - (void)resetWindowGrowthState; | 455 - (void)resetWindowGrowthState; |
| 448 | 456 |
| 449 // Computes by how far in each direction, horizontal and vertical, the | 457 // Computes by how far in each direction, horizontal and vertical, the |
| 450 // |source| rect doesn't fit into |target|. | 458 // |source| rect doesn't fit into |target|. |
| 451 - (NSSize)overflowFrom:(NSRect)source | 459 - (NSSize)overflowFrom:(NSRect)source |
| 452 to:(NSRect)target; | 460 to:(NSRect)target; |
| 453 @end // @interface BrowserWindowController (TestingAPI) | 461 @end // @interface BrowserWindowController (TestingAPI) |
| 454 | 462 |
| 455 | 463 |
| 456 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 464 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| OLD | NEW |