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 "Enter Full Screen". | |
475 // -- This invokes FullscreenController::ToggleFullscreenModeInternal( | |
476 // BROWSER_WITH_CHROME) | |
477 // - User selects the menu item "Enter 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 JavaScript apis. | |
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. | |
491 | 466 |
492 // Methods having to do with fullscreen and presentation mode. | 467 // Methods having to do with fullscreen and presentation mode. |
493 @interface BrowserWindowController(Fullscreen) | 468 @interface BrowserWindowController(Fullscreen) |
494 | 469 |
495 // Toggles fullscreen mode. Meant to be called by Lion windows when they enter | 470 // Toggles fullscreen mode. Meant to be called by Lion windows when they enter |
496 // or exit Lion fullscreen mode. Must not be called on Snow Leopard or earlier. | 471 // or exit Lion fullscreen mode. Must not be called on Snow Leopard or earlier. |
497 - (void)handleLionToggleFullscreen; | 472 - (void)handleLionToggleFullscreen; |
498 | 473 |
499 // Enters Canonical Fullscreen. | 474 // Enters Canonical Fullscreen. |
500 - (void)enterFullscreenWithChrome; | 475 - (void)enterFullscreenWithChrome; |
(...skipping 11 matching lines...) Expand all Loading... |
512 - (BOOL)isInImmersiveFullscreen; | 487 - (BOOL)isInImmersiveFullscreen; |
513 | 488 |
514 // Returns YES if the browser window is currently in or entering fullscreen via | 489 // Returns YES if the browser window is currently in or entering fullscreen via |
515 // the AppKit Fullscreen API. | 490 // the AppKit Fullscreen API. |
516 - (BOOL)isInAppKitFullscreen; | 491 - (BOOL)isInAppKitFullscreen; |
517 | 492 |
518 // Returns YES if the PresentationModeController exists and hence the omnibox | 493 // Returns YES if the PresentationModeController exists and hence the omnibox |
519 // and other UI is expected to slide. | 494 // and other UI is expected to slide. |
520 - (BOOL)isInFullscreenWithOmniboxSliding; | 495 - (BOOL)isInFullscreenWithOmniboxSliding; |
521 | 496 |
522 // Enters presentation mode. | 497 // Enters (or exits) presentation mode. |
523 - (void)enterPresentationMode; | 498 - (void)enterPresentationModeForURL:(const GURL&)url |
524 | 499 bubbleType:(FullscreenExitBubbleType)bubbleType; |
525 // Enter fullscreen for an extension. | |
526 - (void)enterExtensionFullscreenForURL:(const GURL&)url | |
527 bubbleType:(FullscreenExitBubbleType)bubbleType; | |
528 | 500 |
529 // Enters Immersive Fullscreen for the given URL. | 501 // Enters Immersive Fullscreen for the given URL. |
530 - (void)enterWebContentFullscreenForURL:(const GURL&)url | 502 - (void)enterHTML5FullscreenForURL:(const GURL&)url |
531 bubbleType:(FullscreenExitBubbleType)bubbleType; | 503 bubbleType:(FullscreenExitBubbleType)bubbleType; |
532 | 504 |
533 // Exits the current fullscreen mode. | 505 // Exits the current fullscreen mode. |
534 - (void)exitAnyFullscreen; | 506 - (void)exitAnyFullscreen; |
535 | 507 |
536 // Whether the system is in the very specific fullscreen mode: Presentation | 508 // Whether the system is in the very specific fullscreen mode: Presentation |
537 // Mode. | 509 // Mode. |
538 - (BOOL)inPresentationMode; | 510 - (BOOL)inPresentationMode; |
539 | 511 |
540 // Resizes the fullscreen window to fit the screen it's currently on. Called by | 512 // Resizes the fullscreen window to fit the screen it's currently on. Called by |
541 // the PresentationModeController when there is a change in monitor placement or | 513 // the PresentationModeController when there is a change in monitor placement or |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 // positioned relative to. | 578 // positioned relative to. |
607 - (NSRect)omniboxPopupAnchorRect; | 579 - (NSRect)omniboxPopupAnchorRect; |
608 | 580 |
609 // Force a layout of info bars. | 581 // Force a layout of info bars. |
610 - (void)layoutInfoBars; | 582 - (void)layoutInfoBars; |
611 | 583 |
612 @end // @interface BrowserWindowController (TestingAPI) | 584 @end // @interface BrowserWindowController (TestingAPI) |
613 | 585 |
614 | 586 |
615 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 587 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
OLD | NEW |