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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.h

Issue 2355413007: [Mac] Refactor the Fullscreen Toolbar (Closed)
Patch Set: Nits and grits Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller.h
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.h b/chrome/browser/ui/cocoa/browser_window_controller.h
index 75f475ba00d1c1a4e574ad0959e0552ec5cdc9c2..2898aefdbe496eaa0beb9b0b6e01214199678ef5 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.h
+++ b/chrome/browser/ui/cocoa/browser_window_controller.h
@@ -43,13 +43,14 @@ class ExclusiveAccessController;
class ExclusiveAccessContext;
@class FindBarCocoaController;
@class FullscreenModeController;
+@class FullscreenToolbarVisibilityLocksController;
@class FullscreenWindow;
class FullscreenLowPowerCoordinatorCocoa;
@class InfoBarContainerController;
class LocationBarViewMac;
@class OverlayableContentsController;
class PermissionBubbleCocoa;
-@class FullscreenToolbarController;
+class FullscreenToolbarLayoutManager;
class StatusBubbleMac;
@class TabStripController;
@class TabStripView;
@@ -85,8 +86,8 @@ class Command;
base::scoped_nsobject<DevToolsController> devToolsController_;
base::scoped_nsobject<OverlayableContentsController>
overlayableContentsController_;
- base::scoped_nsobject<FullscreenToolbarController>
- fullscreenToolbarController_;
+ std::unique_ptr<FullscreenToolbarLayoutManager>
+ fullscreenToolbarLayoutManager_;
std::unique_ptr<ExclusiveAccessController> exclusiveAccessController_;
base::scoped_nsobject<BrowserWindowFullscreenTransition>
fullscreenTransition_;
@@ -161,9 +162,6 @@ class Command;
// return nil.
BOOL isUsingCustomAnimation_;
- // True if the toolbar needs to be shown in fullscreen.
- BOOL shouldShowFullscreenToolbar_;
-
// True if a call to exit AppKit fullscreen was made during the transition to
// fullscreen.
BOOL shouldExitAfterEnteringFullscreen_;
@@ -181,17 +179,6 @@ class Command;
// The proportion of the floating bar which is shown.
CGFloat floatingBarShownFraction_;
- // Various UI elements/events may want to ensure that the floating bar is
- // visible (in presentation mode), e.g., because of where the mouse is or
- // where keyboard focus is. Whenever an object requires bar visibility, it has
- // itself added to |barVisibilityLocks_|. When it no longer requires bar
- // visibility, it has itself removed.
- base::scoped_nsobject<NSMutableSet> barVisibilityLocks_;
-
- // Bar visibility locks and releases only result (when appropriate) in changes
- // in visible state when the following is |YES|.
- BOOL barVisibilityUpdatesEnabled_;
-
// If this ivar is set to YES, layoutSubviews calls will be ignored. This is
// used in fullscreen transition to prevent spurious resize messages from
// being sent to the renderer, which causes the transition to be janky.
@@ -457,20 +444,6 @@ class Command;
// invoked causes all fullscreen modes to exit.
//
// ----------------------------------------------------------------------------
-// There are 3 "styles" of omnibox sliding.
-// + OMNIBOX_TABS_PRESENT: Both the omnibox and the tabstrip are present.
-// Moving the cursor to the top causes the menubar to appear, and everything
-// else to slide down.
-// + OMNIBOX_TABS_HIDDEN: Both tabstrip and omnibox are hidden. Moving cursor
-// to top shows tabstrip, omnibox, and menu bar.
-// + OMNIBOX_TABS_NONE: Both tabstrip and omnibox are hidden. Moving cursor
-// to top causes the menubar to appear, but not the tabstrip and omnibox.
-//
-// The omnibox sliding styles are used in conjunction with the fullscreen APIs.
-// There is exactly 1 sliding style active at a time. The sliding is mangaged
-// by the fullscreenToolbarController_.
-//
-// ----------------------------------------------------------------------------
// There are several "fullscreen modes" bantered around. Technically, any
// fullscreen API can be combined with any sliding style.
//
@@ -530,9 +503,6 @@ class Command;
// |bubbleType|.
- (void)updateFullscreenExitBubble;
-// Set the toolbar's visibility in fullscreen mode.
-- (void)setFullscreenToolbarVisible:(BOOL)visible;
-
// Returns YES if the browser window is in or entering any fullscreen mode.
- (BOOL)isInAnyFullscreenMode;
@@ -544,6 +514,9 @@ class Command;
// the AppKit Fullscreen API.
- (BOOL)isInAppKitFullscreen;
+// Returns YES if the fullscreen is for tab content or an extension.
+- (BOOL)isFullscreenForTabContentOrExtension;
+
// Enters Immersive Fullscreen for the given URL.
- (void)enterWebContentFullscreen;
@@ -554,24 +527,16 @@ class Command;
// finished.
- (void)exitFullscreenAnimationFinished;
-// Resizes the fullscreen window to fit the screen it's currently on. Called by
-// the FullscreenToolbarController when there is a change in monitor placement
-// or resolution.
+// Resizes the fullscreen window to fit the screen it's currently on. Called by
+// the FullscreenToolbarLayoutManager when there is a change in monitor
+// placement or resolution.
- (void)resizeFullscreenWindow;
-// Query/lock/release the requirement that the tab strip/toolbar/attached
-// bookmark bar bar cluster is visible (e.g., when one of its elements has
-// focus). This is required for the floating bar if it's hidden in fullscreen,
-// but should also be called when not in fullscreen mode; see the comments for
-// |barVisibilityLocks_| for more details. Double locks/releases by the same
-// owner are ignored. If |animate:| is YES, then an animation may be
-// performed. In the case of multiple calls, later calls have precedence with
-// the rule that |animate:NO| has precedence over |animate:YES|. If |owner| is
-// nil in isBarVisibilityLockedForOwner, the method returns YES if there are
-// any locks.
-- (BOOL)isBarVisibilityLockedForOwner:(id)owner;
-- (void)lockBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate;
-- (void)releaseBarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate;
+// Methods for querying, locking, and releasing the fullscreen toolbar's
+// visibility.
+- (BOOL)isToolbarVisibilityLockedForOwner:(id)owner;
+- (void)lockToolbarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate;
+- (void)releaseToolbarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate;
// Returns YES if any of the views in the floating bar currently has focus.
- (BOOL)floatingBarHasFocus;
@@ -579,6 +544,13 @@ class Command;
// Accessor for the controller managing fullscreen ExclusiveAccessContext.
- (ExclusiveAccessController*)exclusiveAccessController;
+// Accessor for the manager managing fullscreen toolbar layout.
+- (FullscreenToolbarLayoutManager*)fullscreenToolbarLayoutManager;
+
+// Accessor for the controller managing fullscreen toolbar layout.
+- (FullscreenToolbarVisibilityLocksController*)
+ fullscreenToolbarVisibilityLocksController;
+
@end // @interface BrowserWindowController(Fullscreen)
@@ -626,10 +598,11 @@ class Command;
- (BOOL)isActiveTabContentsControllerResizeBlocked;
// Returns the fullscreen toolbar controller.
-- (FullscreenToolbarController*)fullscreenToolbarController;
+- (FullscreenToolbarLayoutManager*)fullscreenToolbarLayoutManager;
// Sets the fullscreen toolbar controller.
-- (void)setFullscreenToolbarController:(FullscreenToolbarController*)controller;
+- (void)setFullscreenToolbarLayoutManager:
+ (FullscreenToolbarLayoutManager*)manager;
@end // @interface BrowserWindowController (TestingAPI)

Powered by Google App Engine
This is Rietveld 408576698