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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 // AppKitFullscreen API. | 456 // AppKitFullscreen API. |
457 // | 457 // |
458 // + Presentation Mode: | 458 // + Presentation Mode: |
459 // - OMNIBOX_TABS_HIDDEN, typically with AppKitFullscreen API, but can | 459 // - OMNIBOX_TABS_HIDDEN, typically with AppKitFullscreen API, but can |
460 // also be with Immersive fullscreen API. | 460 // also be with Immersive fullscreen API. |
461 // - This class sets a flag, indicating that it wants Presentation Mode | 461 // - This class sets a flag, indicating that it wants Presentation Mode |
462 // instead of Canonical Fullscreen. Then it invokes the AppKitFullscreen API. | 462 // instead of Canonical Fullscreen. Then it invokes the AppKitFullscreen API. |
463 // | 463 // |
464 // + HTML5 fullscreen. <-- Currently uses AppKitFullscreen API. This should | 464 // + HTML5 fullscreen. <-- Currently uses AppKitFullscreen API. This should |
465 // eventually migrate to the Immersive Fullscreen API. | 465 // eventually migrate to the Immersive Fullscreen API. |
466 // | |
467 // There are more fullscreen styles on OSX than other OSes. However, all OSes | |
468 // share the same cross-platform code for entering fullscreen | |
469 // (FullscreenController). It is important for OSX fullscreen logic to track | |
470 // how the user triggered fullscreen mode. | |
471 // There are currently 5 possible mechanisms: | |
472 // - User clicks the AppKit Fullscreen button. | |
473 // -- This invokes -[BrowserWindowController windowWillEnterFullscreen:] | |
474 // - User selects the menu item corresponding to "Canonical Fullscreen". | |
Robert Sesek
2014/09/16 15:49:02
We're not going to call it that in the menu, so th
erikchen
2014/09/16 17:12:36
I was intentionally using the internal names for t
| |
475 // -- This invokes FullscreenController::ToggleFullscreenModeInternal( | |
476 // BROWSER_WITH_CHROME) | |
477 // - User selects the menu item corresponding to "Presentation Mode". | |
478 // -- This invokes FullscreenController::ToggleFullscreenModeInternal( | |
479 // BROWSER) | |
480 // -- The corresponding URL will be empty. | |
481 // - User requests fullscreen via an extension. | |
482 // -- This invokes FullscreenController::ToggleFullscreenModeInternal( | |
483 // BROWSER) | |
484 // -- The corresponding URL will be the url of the extension. | |
485 // - User requests fullscreen via Flash or js apis. | |
Robert Sesek
2014/09/16 15:49:02
js -> JavaScript
erikchen
2014/09/16 17:12:36
Done.
| |
486 // -- This invokes FullscreenController::ToggleFullscreenModeInternal( | |
487 // BROWSER) | |
488 // -- browser_->fullscreen_controller()-> | |
489 // IsWindowFullscreenForTabOrPending() returns true. | |
490 // -- The corresponding URL will be the url of the web page. | |
466 | 491 |
467 // Methods having to do with fullscreen and presentation mode. | 492 // Methods having to do with fullscreen and presentation mode. |
468 @interface BrowserWindowController(Fullscreen) | 493 @interface BrowserWindowController(Fullscreen) |
469 | 494 |
470 // Toggles fullscreen mode. Meant to be called by Lion windows when they enter | 495 // Toggles fullscreen mode. Meant to be called by Lion windows when they enter |
471 // or exit Lion fullscreen mode. Must not be called on Snow Leopard or earlier. | 496 // or exit Lion fullscreen mode. Must not be called on Snow Leopard or earlier. |
472 - (void)handleLionToggleFullscreen; | 497 - (void)handleLionToggleFullscreen; |
473 | 498 |
474 // Enters Canonical Fullscreen. | 499 // Enters Canonical Fullscreen. |
475 - (void)enterFullscreenWithChrome; | 500 - (void)enterFullscreenWithChrome; |
(...skipping 11 matching lines...) Expand all Loading... | |
487 - (BOOL)isInImmersiveFullscreen; | 512 - (BOOL)isInImmersiveFullscreen; |
488 | 513 |
489 // 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 |
490 // the AppKit Fullscreen API. | 515 // the AppKit Fullscreen API. |
491 - (BOOL)isInAppKitFullscreen; | 516 - (BOOL)isInAppKitFullscreen; |
492 | 517 |
493 // Returns YES if the PresentationModeController exists and hence the omnibox | 518 // Returns YES if the PresentationModeController exists and hence the omnibox |
494 // and other UI is expected to slide. | 519 // and other UI is expected to slide. |
495 - (BOOL)isInFullscreenWithOmniboxSliding; | 520 - (BOOL)isInFullscreenWithOmniboxSliding; |
496 | 521 |
497 // Enters (or exits) presentation mode. | 522 // Enters presentation mode. |
498 - (void)enterPresentationModeForURL:(const GURL&)url | 523 - (void)enterPresentationMode; |
499 bubbleType:(FullscreenExitBubbleType)bubbleType; | 524 |
525 // Enter fullscreen for an extension. | |
526 - (void)enterExtensionFullscreenForURL:(const GURL&)url | |
527 bubbleType:(FullscreenExitBubbleType)bubbleType; | |
500 | 528 |
501 // Enters Immersive Fullscreen for the given URL. | 529 // Enters Immersive Fullscreen for the given URL. |
502 - (void)enterHTML5FullscreenForURL:(const GURL&)url | 530 - (void)enterWebContentFullscreenForURL:(const GURL&)url |
503 bubbleType:(FullscreenExitBubbleType)bubbleType; | 531 bubbleType:(FullscreenExitBubbleType)bubbleType; |
504 | 532 |
505 // Exits the current fullscreen mode. | 533 // Exits the current fullscreen mode. |
506 - (void)exitAnyFullscreen; | 534 - (void)exitAnyFullscreen; |
507 | 535 |
508 // Whether the system is in the very specific fullscreen mode: Presentation | 536 // Whether the system is in the very specific fullscreen mode: Presentation |
509 // Mode. | 537 // Mode. |
510 - (BOOL)inPresentationMode; | 538 - (BOOL)inPresentationMode; |
511 | 539 |
512 // Resizes the fullscreen window to fit the screen it's currently on. Called by | 540 // Resizes the fullscreen window to fit the screen it's currently on. Called by |
513 // the PresentationModeController when there is a change in monitor placement or | 541 // the PresentationModeController when there is a change in monitor placement or |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
578 // positioned relative to. | 606 // positioned relative to. |
579 - (NSRect)omniboxPopupAnchorRect; | 607 - (NSRect)omniboxPopupAnchorRect; |
580 | 608 |
581 // Force a layout of info bars. | 609 // Force a layout of info bars. |
582 - (void)layoutInfoBars; | 610 - (void)layoutInfoBars; |
583 | 611 |
584 @end // @interface BrowserWindowController (TestingAPI) | 612 @end // @interface BrowserWindowController (TestingAPI) |
585 | 613 |
586 | 614 |
587 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 615 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |