OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "modules/vr/VRDisplay.h" | 5 #include "modules/vr/VRDisplay.h" |
6 | 6 |
7 #include "core/css/StylePropertySet.h" | 7 #include "core/css/StylePropertySet.h" |
8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
9 #include "core/dom/DocumentUserGestureToken.h" | 9 #include "core/dom/DocumentUserGestureToken.h" |
10 #include "core/dom/FrameRequestCallback.h" | 10 #include "core/dom/FrameRequestCallback.h" |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 canvas->setInlineStyleProperty(CSSPropertyHeight, "100%"); | 479 canvas->setInlineStyleProperty(CSSPropertyHeight, "100%"); |
480 } | 480 } |
481 } else { | 481 } else { |
482 m_fullscreenOrigWidth = String(); | 482 m_fullscreenOrigWidth = String(); |
483 m_fullscreenOrigHeight = String(); | 483 m_fullscreenOrigHeight = String(); |
484 } | 484 } |
485 | 485 |
486 if (doc) { | 486 if (doc) { |
487 // Since the callback for requestPresent is asynchronous, we've lost our | 487 // Since the callback for requestPresent is asynchronous, we've lost our |
488 // UserGestureToken, and need to create a new one to enter fullscreen. | 488 // UserGestureToken, and need to create a new one to enter fullscreen. |
489 gestureIndicator = | 489 gestureIndicator = WTF::wrapUnique( |
490 wrapUnique(new UserGestureIndicator(DocumentUserGestureToken::create( | 490 new UserGestureIndicator(DocumentUserGestureToken::create( |
491 doc, UserGestureToken::Status::PossiblyExistingGesture))); | 491 doc, UserGestureToken::Status::PossiblyExistingGesture))); |
492 } | 492 } |
493 Fullscreen::requestFullscreen(*canvas, Fullscreen::UnprefixedRequest); | 493 Fullscreen::requestFullscreen(*canvas, Fullscreen::UnprefixedRequest); |
494 | 494 |
495 // Check to see if the canvas is still the current fullscreen | 495 // Check to see if the canvas is still the current fullscreen |
496 // element once every 2 seconds. | 496 // element once every 2 seconds. |
497 m_fullscreenCheckTimer.startRepeating(2.0, BLINK_FROM_HERE); | 497 m_fullscreenCheckTimer.startRepeating(2.0, BLINK_FROM_HERE); |
498 m_reenteredFullscreen = false; | 498 m_reenteredFullscreen = false; |
499 } | 499 } |
500 | 500 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 m_fullscreenCheckTimer.stop(); | 717 m_fullscreenCheckTimer.stop(); |
718 if (m_display) | 718 if (m_display) |
719 m_display->ExitPresent(); | 719 m_display->ExitPresent(); |
720 return; | 720 return; |
721 } | 721 } |
722 m_reenteredFullscreen = true; | 722 m_reenteredFullscreen = true; |
723 auto canvas = m_layer.source(); | 723 auto canvas = m_layer.source(); |
724 Document* doc = this->document(); | 724 Document* doc = this->document(); |
725 std::unique_ptr<UserGestureIndicator> gestureIndicator; | 725 std::unique_ptr<UserGestureIndicator> gestureIndicator; |
726 if (doc) { | 726 if (doc) { |
727 gestureIndicator = | 727 gestureIndicator = WTF::wrapUnique( |
728 wrapUnique(new UserGestureIndicator(DocumentUserGestureToken::create( | 728 new UserGestureIndicator(DocumentUserGestureToken::create( |
729 doc, UserGestureToken::Status::PossiblyExistingGesture))); | 729 doc, UserGestureToken::Status::PossiblyExistingGesture))); |
730 } | 730 } |
731 Fullscreen::requestFullscreen(*canvas, Fullscreen::UnprefixedRequest); | 731 Fullscreen::requestFullscreen(*canvas, Fullscreen::UnprefixedRequest); |
732 } | 732 } |
733 } | 733 } |
734 | 734 |
735 ScriptedAnimationController& VRDisplay::ensureScriptedAnimationController( | 735 ScriptedAnimationController& VRDisplay::ensureScriptedAnimationController( |
736 Document* doc) { | 736 Document* doc) { |
737 if (!m_scriptedAnimationController) | 737 if (!m_scriptedAnimationController) |
738 m_scriptedAnimationController = ScriptedAnimationController::create(doc); | 738 m_scriptedAnimationController = ScriptedAnimationController::create(doc); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 visitor->trace(m_stageParameters); | 770 visitor->trace(m_stageParameters); |
771 visitor->trace(m_eyeParametersLeft); | 771 visitor->trace(m_eyeParametersLeft); |
772 visitor->trace(m_eyeParametersRight); | 772 visitor->trace(m_eyeParametersRight); |
773 visitor->trace(m_layer); | 773 visitor->trace(m_layer); |
774 visitor->trace(m_renderingContext); | 774 visitor->trace(m_renderingContext); |
775 visitor->trace(m_scriptedAnimationController); | 775 visitor->trace(m_scriptedAnimationController); |
776 visitor->trace(m_pendingPresentResolvers); | 776 visitor->trace(m_pendingPresentResolvers); |
777 } | 777 } |
778 | 778 |
779 } // namespace blink | 779 } // namespace blink |
OLD | NEW |