| 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = WTF::wrapUnique( | 489 gestureIndicator = WTF::wrapUnique( |
| 490 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); |
| 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 |
| 501 if (doc) { | 501 if (doc) { |
| 502 Platform::current()->recordRapporURL("VR.WebVR.PresentSuccess", | 502 Platform::current()->recordRapporURL("VR.WebVR.PresentSuccess", |
| 503 WebURL(doc->url())); | 503 WebURL(doc->url())); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = WTF::wrapUnique( | 727 gestureIndicator = WTF::wrapUnique( |
| 728 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); |
| 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); |
| 739 | 739 |
| 740 return *m_scriptedAnimationController; | 740 return *m_scriptedAnimationController; |
| 741 } | 741 } |
| (...skipping 28 matching lines...) Expand all 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 |