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

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

Issue 493143004: mac: Major fullscreen refactor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests. Created 6 years, 4 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 020e099718298395f48578c5ef3b6c6d9234eec9..9e7a9a67ddaee752e8a9199f4b0a3c6e21a10939 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.h
+++ b/chrome/browser/ui/cocoa/browser_window_controller.h
@@ -57,6 +57,14 @@ namespace extensions {
class Command;
}
+namespace fullscreen_mac {
+enum SlidingStyle {
+ OMNIBOX_TABS_PRESENT = 0, // Tab strip and omnibox both visible.
+ OMNIBOX_PRESENT, // Tab strip hidden.
+ OMNIBOX_TABS_HIDDEN, // Tab strip and omnibox both hidden.
+};
+} // namespace fullscreen_mac
+
@interface BrowserWindowController :
TabWindowController<NSUserInterfaceValidations,
BookmarkBarControllerDelegate,
@@ -81,7 +89,6 @@ class Command;
base::scoped_nsobject<OverlayableContentsController>
overlayableContentsController_;
base::scoped_nsobject<PresentationModeController> presentationModeController_;
- base::scoped_nsobject<FullscreenModeController> fullscreenModeController_;
base::scoped_nsobject<FullscreenExitBubbleController>
fullscreenExitBubbleController_;
@@ -132,8 +139,13 @@ class Command;
// True between |-windowWillEnterFullScreen:| and |-windowDidEnterFullScreen:|
// to indicate that the window is in the process of transitioning into
- // fullscreen mode.
- BOOL enteringFullscreen_;
+ // AppKit fullscreen mode.
+ BOOL enteringAppKitFullscreen_;
+
+ // True between |enterImmersiveFullscreen| and |-windowDidEnterFullScreen:|
+ // to indicate that the window is in the process of transitioning into
+ // AppKit fullscreen mode.
+ BOOL enteringImmersiveFullscreen_;
// True between |-setPresentationMode:url:bubbleType:| and
// |-windowDidEnterFullScreen:| to indicate that the window is in the process
@@ -148,6 +160,9 @@ class Command;
// The proportion of the floating bar which is shown (in presentation mode).
CGFloat floatingBarShownFraction_;
+ // Whether the omnibox is hidden in fullscreen.
+ fullscreen_mac::SlidingStyle fullscreenStyle_;
+
// 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
@@ -395,6 +410,69 @@ class Command;
@end // @interface BrowserWindowController(WindowType)
+// Fullscreen terminology:
+//
+// ----------------------------------------------------------------------------
+// There are 2 APIs that cause the window to get resized, and possibly move
+// spaces.
+//
+// + AppKitFullscreen API: AppKit touts a feature known as "fullscreen". This
+// involves moving the current window to a different space, and resizing the
+// window to take up the entire size of the screen.
+//
+// + Immersive fullscreen: An alternative to AppKitFullscreen API. Uses on 10.6
+// (before AppKitFullscreen API was available), and on certain HTML/Flash
+// content. This is a method defined by Chrome.
+//
+// The Immersive fullscreen API can be called after the AppKitFullscreen API.
+// Calling the AppKitFullscreen API while immersive fullscreen API has been
+// 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_PRESENT: The tabstrip is hidden. Moving the cursor to the top
+// shows the tabstrip and menubar, sliding everything else down.
+// + OMNIBOX_TABS_HIDDEN: Both tabstrip and omnibox are hidden. Moving cursor
+// to top shows tabstrip, omnibox, and menu bar.
+//
+// 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 presentationModeController_. (poorly named).
+//
+// ----------------------------------------------------------------------------
+// There are several "fullscreen modes" bantered around. Technically, any
+// fullscreen API can be combined with any sliding style.
+//
+// + System fullscreen***deprecated***: This term is confusing. Don't use it.
+// It either refers to the AppKitFullscreen API, or the behavior that users
+// expect to see when they click the fullscreen button, or some Chrome specific
+// implementation that uses the AppKitFullscreen API.
+//
+// + Canonical Fullscreen: When a user clicks on the fullscreen button, they
+// expect a fullscreen behavior similar to other AppKit apps.
+// - AppKitFullscreen API + OMNIBOX_TABS_PRESENT.
+// - The button click directly invokes the AppKitFullscreen API. This class
+// get a callback, and calls adjustUIForOmniboxFullscreen.
+// - There is a menu item that is intended to invoke the same behavior. When
+// the user clicks the menu item, or use its hotkey, this class invokes the
+// AppKitFullscreen API.
+//
+// + Presentation Mode:
+// - OMNIBOX_TABS_HIDDEN, typically with AppKitFullscreen API, but can
+// also be with Immersive fullscreen API.
+// - This class sets a flag, indicating that it wants Presentation Mode
+// instead of Canonical Fullscreen. Then it invokes the AppKitFullscreen API.
+//
+// + HTML5 fullscreen. <-- Currently uses AppKitFullscreen API. This should
+// eventually migrate to the Immersive Fullscreen API.
+//
+// TODO(erikchen): Remove this.
+// + Simplified fullscreen. Hidden by default. Some users have manually
+// enabled it.
+// - OMNIBOX_PRESENT. Can be with either fullscreen API.
// Methods having to do with fullscreen and presentation mode.
@interface BrowserWindowController(Fullscreen)
@@ -403,43 +481,42 @@ class Command;
// or exit Lion fullscreen mode. Must not be called on Snow Leopard or earlier.
- (void)handleLionToggleFullscreen;
-// Enters (or exits) fullscreen mode. This method is safe to call on all OS
-// versions.
-- (void)enterFullscreen;
-- (void)exitFullscreen;
+// Enters Canonical Fullscreen.
+- (void)enterFullscreenWithChrome;
// Updates the contents of the fullscreen exit bubble with |url| and
// |bubbleType|.
- (void)updateFullscreenExitBubbleURL:(const GURL&)url
bubbleType:(FullscreenExitBubbleType)bubbleType;
-// Returns fullscreen state: YES when the window is in fullscreen or is
-// animating into fullscreen.
-- (BOOL)isFullscreen;
+// Returns YES if the browser window is in or entering any fullscreen mode.
+- (BOOL)isInAnyFullscreenMode;
-// Returns YES if the browser window is currently in fullscreen via the built-in
-// immersive mechanism.
+// Returns YES if the browser window is currently in or entering fullscreen via
+// the built-in immersive mechanism.
- (BOOL)isInImmersiveFullscreen;
-// Returns YES if the browser window is currently in fullscreen via the Cocoa
-// System Fullscreen API.
-- (BOOL)isInSystemFullscreen;
+// Returns YES if the browser window is currently in or entering fullscreen via
+// the AppKit Fullscreen API.
+- (BOOL)isInAppKitFullscreen;
+
+// Returns YES if the PresentationModeController exists and hence the omnibox
+// and other UI is expected to slide.
+- (BOOL)isInFullscreenWithOmniboxSliding;
-// Enters (or exits) presentation mode. Also enters fullscreen mode if this
-// window is not already fullscreen. This method is safe to call on all OS
-// versions.
+// Enters (or exits) presentation mode.
- (void)enterPresentationModeForURL:(const GURL&)url
bubbleType:(FullscreenExitBubbleType)bubbleType;
-- (void)exitPresentationMode;
-// For simplified fullscreen: Enters fullscreen for a tab at a URL. The |url|
-// is guaranteed to be non-empty; see -enterFullscreen for the user-initiated
-// fullscreen mode. Called on Snow Leopard and Lion+.
-- (void)enterFullscreenForURL:(const GURL&)url
- bubbleType:(FullscreenExitBubbleType)bubbleType;
+// Tries to enter presentation mode. Falls back to simplified fullscreen.
+- (void)enterHTML5FullscreenForURL:(const GURL&)url
+ bubbleType:(FullscreenExitBubbleType)bubbleType;
+
+// Exits the current fullscreen mode.
+- (void)exitAnyFullscreen;
-// Returns presentation mode state. This method is safe to call on all OS
-// versions.
+// Whether the system is in the very specific fullscreen mode: Presentation
+// Mode.
- (BOOL)inPresentationMode;
// Resizes the fullscreen window to fit the screen it's currently on. Called by
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698