| 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 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // When the window is in the process of entering AppKit Fullscreen, this | 155 // When the window is in the process of entering AppKit Fullscreen, this |
| 156 // property indicates whether the window is being fullscreened on the | 156 // property indicates whether the window is being fullscreened on the |
| 157 // primary screen. | 157 // primary screen. |
| 158 BOOL enteringAppKitFullscreenOnPrimaryScreen_; | 158 BOOL enteringAppKitFullscreenOnPrimaryScreen_; |
| 159 | 159 |
| 160 // This flag is set to true when |customWindowsToEnterFullScreenForWindow:| | 160 // This flag is set to true when |customWindowsToEnterFullScreenForWindow:| |
| 161 // and |customWindowsToExitFullScreenForWindow:| are called and did not | 161 // and |customWindowsToExitFullScreenForWindow:| are called and did not |
| 162 // return nil. | 162 // return nil. |
| 163 BOOL isUsingCustomAnimation_; | 163 BOOL isUsingCustomAnimation_; |
| 164 | 164 |
| 165 // True if the toolbar needs to be shown in fullscreen. | |
| 166 BOOL shouldShowFullscreenToolbar_; | |
| 167 | |
| 168 // True if a call to exit AppKit fullscreen was made during the transition to | 165 // True if a call to exit AppKit fullscreen was made during the transition to |
| 169 // fullscreen. | 166 // fullscreen. |
| 170 BOOL shouldExitAfterEnteringFullscreen_; | 167 BOOL shouldExitAfterEnteringFullscreen_; |
| 171 | 168 |
| 172 // True if AppKit has finished exiting fullscreen before the exit animation | 169 // True if AppKit has finished exiting fullscreen before the exit animation |
| 173 // is completed. This flag is used to ensure that |windowDidExitFullscreen| | 170 // is completed. This flag is used to ensure that |windowDidExitFullscreen| |
| 174 // is called after the exit fullscreen animation is complete. | 171 // is called after the exit fullscreen animation is complete. |
| 175 BOOL appKitDidExitFullscreen_; | 172 BOOL appKitDidExitFullscreen_; |
| 176 | 173 |
| 177 // The size of the original (non-fullscreen) window. This is saved just | 174 // The size of the original (non-fullscreen) window. This is saved just |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // window to take up the entire size of the screen. | 437 // window to take up the entire size of the screen. |
| 441 // | 438 // |
| 442 // + Immersive fullscreen: An alternative to AppKitFullscreen API. Uses on 10.9 | 439 // + Immersive fullscreen: An alternative to AppKitFullscreen API. Uses on 10.9 |
| 443 // on certain HTML/Flash content. This is a method defined by Chrome. | 440 // on certain HTML/Flash content. This is a method defined by Chrome. |
| 444 // | 441 // |
| 445 // The Immersive fullscreen API can be called after the AppKitFullscreen API. | 442 // The Immersive fullscreen API can be called after the AppKitFullscreen API. |
| 446 // Calling the AppKitFullscreen API while immersive fullscreen API has been | 443 // Calling the AppKitFullscreen API while immersive fullscreen API has been |
| 447 // invoked causes all fullscreen modes to exit. | 444 // invoked causes all fullscreen modes to exit. |
| 448 // | 445 // |
| 449 // ---------------------------------------------------------------------------- | 446 // ---------------------------------------------------------------------------- |
| 450 // There are 3 "styles" of omnibox sliding. | |
| 451 // + OMNIBOX_TABS_PRESENT: Both the omnibox and the tabstrip are present. | |
| 452 // Moving the cursor to the top causes the menubar to appear, and everything | |
| 453 // else to slide down. | |
| 454 // + OMNIBOX_TABS_HIDDEN: Both tabstrip and omnibox are hidden. Moving cursor | |
| 455 // to top shows tabstrip, omnibox, and menu bar. | |
| 456 // + OMNIBOX_TABS_NONE: Both tabstrip and omnibox are hidden. Moving cursor | |
| 457 // to top causes the menubar to appear, but not the tabstrip and omnibox. | |
| 458 // | 447 // |
| 459 // The omnibox sliding styles are used in conjunction with the fullscreen APIs. | |
| 460 // There is exactly 1 sliding style active at a time. The sliding is mangaged | |
| 461 // by the fullscreenToolbarController_. | |
| 462 // | |
| 463 // ---------------------------------------------------------------------------- | |
| 464 // There are several "fullscreen modes" bantered around. Technically, any | 448 // There are several "fullscreen modes" bantered around. Technically, any |
| 465 // fullscreen API can be combined with any sliding style. | 449 // fullscreen API can be combined with any sliding style. |
| 466 // | 450 // |
| 467 // + System fullscreen***deprecated***: This term is confusing. Don't use it. | 451 // + System fullscreen***deprecated***: This term is confusing. Don't use it. |
| 468 // It either refers to the AppKitFullscreen API, or the behavior that users | 452 // It either refers to the AppKitFullscreen API, or the behavior that users |
| 469 // expect to see when they click the fullscreen button, or some Chrome specific | 453 // expect to see when they click the fullscreen button, or some Chrome specific |
| 470 // implementation that uses the AppKitFullscreen API. | 454 // implementation that uses the AppKitFullscreen API. |
| 471 // | 455 // |
| 472 // + Canonical Fullscreen: When a user clicks on the fullscreen button, they | 456 // + Canonical Fullscreen: When a user clicks on the fullscreen button, they |
| 473 // expect a fullscreen behavior similar to other AppKit apps. | 457 // expect a fullscreen behavior similar to other AppKit apps. |
| 474 // - AppKitFullscreen API + OMNIBOX_TABS_PRESENT/OMNIBOX_TABS_HIDDEN. | 458 // - AppKitFullscreen API + TOOLBAR_PRESENT/TOOLBAR_HIDDEN. |
| 475 // - The button click directly invokes the AppKitFullscreen API. This class | 459 // - The button click directly invokes the AppKitFullscreen API. This class |
| 476 // get a callback, and calls adjustUIForOmniboxFullscreen. | 460 // get a callback, and calls adjustUIForOmniboxFullscreen. |
| 477 // - There is a menu item that is intended to invoke the same behavior. When | 461 // - There is a menu item that is intended to invoke the same behavior. When |
| 478 // the user clicks the menu item, or use its hotkey, this class invokes the | 462 // the user clicks the menu item, or use its hotkey, this class invokes the |
| 479 // AppKitFullscreen API. | 463 // AppKitFullscreen API. |
| 480 // | 464 // |
| 481 // + HTML5 fullscreen. Uses AppKitFullscreen in 10.10+, otherwise Immersive. | 465 // + HTML5 fullscreen. Uses AppKitFullscreen in 10.10+, otherwise Immersive. |
| 482 // | 466 // |
| 483 // There are more fullscreen styles on OSX than other OSes. However, all OSes | 467 // There are more fullscreen styles on OSX than other OSes. However, all OSes |
| 484 // share the same cross-platform code for entering fullscreen | 468 // share the same cross-platform code for entering fullscreen |
| (...skipping 28 matching lines...) Expand all Loading... |
| 513 (ExclusiveAccessContext::TabFullscreenState)state; | 497 (ExclusiveAccessContext::TabFullscreenState)state; |
| 514 | 498 |
| 515 // Exits extension fullscreen if we're currently in the mode. Returns YES | 499 // Exits extension fullscreen if we're currently in the mode. Returns YES |
| 516 // if we exited fullscreen. | 500 // if we exited fullscreen. |
| 517 - (BOOL)exitExtensionFullscreenIfPossible; | 501 - (BOOL)exitExtensionFullscreenIfPossible; |
| 518 | 502 |
| 519 // Updates the contents of the fullscreen exit bubble with |url| and | 503 // Updates the contents of the fullscreen exit bubble with |url| and |
| 520 // |bubbleType|. | 504 // |bubbleType|. |
| 521 - (void)updateFullscreenExitBubble; | 505 - (void)updateFullscreenExitBubble; |
| 522 | 506 |
| 523 // Set the toolbar's visibility in fullscreen mode. | |
| 524 - (void)setFullscreenToolbarVisible:(BOOL)visible; | |
| 525 | |
| 526 // Returns YES if the browser window is in or entering any fullscreen mode. | 507 // Returns YES if the browser window is in or entering any fullscreen mode. |
| 527 - (BOOL)isInAnyFullscreenMode; | 508 - (BOOL)isInAnyFullscreenMode; |
| 528 | 509 |
| 529 // Returns YES if the browser window is currently in or entering fullscreen via | 510 // Returns YES if the browser window is currently in or entering fullscreen via |
| 530 // the built-in immersive mechanism. | 511 // the built-in immersive mechanism. |
| 531 - (BOOL)isInImmersiveFullscreen; | 512 - (BOOL)isInImmersiveFullscreen; |
| 532 | 513 |
| 533 // Returns YES if the browser window is currently in or entering fullscreen via | 514 // Returns YES if the browser window is currently in or entering fullscreen via |
| 534 // the AppKit Fullscreen API. | 515 // the AppKit Fullscreen API. |
| 535 - (BOOL)isInAppKitFullscreen; | 516 - (BOOL)isInAppKitFullscreen; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 559 // the rule that |animate:NO| has precedence over |animate:YES|. If |owner| is | 540 // the rule that |animate:NO| has precedence over |animate:YES|. If |owner| is |
| 560 // nil in isToolbarVisibilityLockedForOwner, the method returns YES if there are | 541 // nil in isToolbarVisibilityLockedForOwner, the method returns YES if there are |
| 561 // any locks. | 542 // any locks. |
| 562 - (BOOL)isToolbarVisibilityLockedForOwner:(id)owner; | 543 - (BOOL)isToolbarVisibilityLockedForOwner:(id)owner; |
| 563 - (void)lockToolbarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate; | 544 - (void)lockToolbarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate; |
| 564 - (void)releaseToolbarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate; | 545 - (void)releaseToolbarVisibilityForOwner:(id)owner withAnimation:(BOOL)animate; |
| 565 | 546 |
| 566 // Returns YES if any of the views in the floating bar currently has focus. | 547 // Returns YES if any of the views in the floating bar currently has focus. |
| 567 - (BOOL)floatingBarHasFocus; | 548 - (BOOL)floatingBarHasFocus; |
| 568 | 549 |
| 550 // Returns YES if the fullscreen is for tab content or an extension. |
| 551 - (BOOL)isFullscreenForTabContentOrExtension; |
| 552 |
| 569 // Accessor for the controller managing fullscreen ExclusiveAccessContext. | 553 // Accessor for the controller managing fullscreen ExclusiveAccessContext. |
| 570 - (ExclusiveAccessController*)exclusiveAccessController; | 554 - (ExclusiveAccessController*)exclusiveAccessController; |
| 571 | 555 |
| 572 @end // @interface BrowserWindowController(Fullscreen) | 556 @end // @interface BrowserWindowController(Fullscreen) |
| 573 | 557 |
| 574 | 558 |
| 575 // Methods which are either only for testing, or only public for testing. | 559 // Methods which are either only for testing, or only public for testing. |
| 576 @interface BrowserWindowController (TestingAPI) | 560 @interface BrowserWindowController (TestingAPI) |
| 577 | 561 |
| 578 // Put the incognito badge or multi-profile avatar on the browser and adjust the | 562 // Put the incognito badge or multi-profile avatar on the browser and adjust the |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 // Returns the fullscreen toolbar controller. | 602 // Returns the fullscreen toolbar controller. |
| 619 - (FullscreenToolbarController*)fullscreenToolbarController; | 603 - (FullscreenToolbarController*)fullscreenToolbarController; |
| 620 | 604 |
| 621 // Sets the fullscreen toolbar controller. | 605 // Sets the fullscreen toolbar controller. |
| 622 - (void)setFullscreenToolbarController:(FullscreenToolbarController*)controller; | 606 - (void)setFullscreenToolbarController:(FullscreenToolbarController*)controller; |
| 623 | 607 |
| 624 @end // @interface BrowserWindowController (TestingAPI) | 608 @end // @interface BrowserWindowController (TestingAPI) |
| 625 | 609 |
| 626 | 610 |
| 627 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 611 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| OLD | NEW |