Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: third_party/WebKit/Source/modules/vr/NavigatorVRDevice.cpp

Issue 1918143007: Updated Blink WebVR interfaces to WebVR v1 spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webvr_mojo
Patch Set: Fixed layout test Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/vr/NavigatorVRDevice.cpp
diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVRDevice.cpp b/third_party/WebKit/Source/modules/vr/NavigatorVRDevice.cpp
deleted file mode 100644
index 1b72cc4221ea5a665315719e16a4d5c6155c469b..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/modules/vr/NavigatorVRDevice.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "modules/vr/NavigatorVRDevice.h"
-
-#include "bindings/core/v8/ScriptPromiseResolver.h"
-#include "core/dom/DOMException.h"
-#include "core/dom/Document.h"
-#include "core/dom/ExceptionCode.h"
-#include "core/frame/LocalDOMWindow.h"
-#include "core/frame/LocalFrame.h"
-#include "core/frame/Navigator.h"
-#include "core/page/Page.h"
-#include "modules/vr/HMDVRDevice.h"
-#include "modules/vr/PositionSensorVRDevice.h"
-#include "modules/vr/VRController.h"
-#include "modules/vr/VRGetDevicesCallback.h"
-#include "modules/vr/VRHardwareUnit.h"
-#include "modules/vr/VRHardwareUnitCollection.h"
-#include "modules/vr/VRPositionState.h"
-#include "wtf/PtrUtil.h"
-
-namespace blink {
-
-NavigatorVRDevice* NavigatorVRDevice::from(Document& document)
-{
- if (!document.frame() || !document.frame()->domWindow())
- return 0;
- Navigator& navigator = *document.frame()->domWindow()->navigator();
- return &from(navigator);
-}
-
-NavigatorVRDevice& NavigatorVRDevice::from(Navigator& navigator)
-{
- NavigatorVRDevice* supplement = static_cast<NavigatorVRDevice*>(Supplement<Navigator>::from(navigator, supplementName()));
- if (!supplement) {
- supplement = new NavigatorVRDevice(navigator.frame());
- provideTo(navigator, supplementName(), supplement);
- }
- return *supplement;
-}
-
-ScriptPromise NavigatorVRDevice::getVRDevices(ScriptState* scriptState, Navigator& navigator)
-{
- return NavigatorVRDevice::from(navigator).getVRDevices(scriptState);
-}
-
-ScriptPromise NavigatorVRDevice::getVRDevices(ScriptState* scriptState)
-{
- ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
- ScriptPromise promise = resolver->promise();
-
- Document* document = m_frame ? m_frame->document() : 0;
-
- if (!document || !controller()) {
- DOMException* exception = DOMException::create(InvalidStateError, "The object is no longer associated to a document.");
- resolver->reject(exception);
- return promise;
- }
-
- controller()->getDevices(WTF::wrapUnique(new VRGetDevicesCallback(resolver, m_hardwareUnits.get())));
-
- return promise;
-}
-
-VRController* NavigatorVRDevice::controller()
-{
- if (!frame())
- return 0;
-
- return VRController::from(*frame());
-}
-
-DEFINE_TRACE(NavigatorVRDevice)
-{
- visitor->trace(m_hardwareUnits);
-
- Supplement<Navigator>::trace(visitor);
- DOMWindowProperty::trace(visitor);
-}
-
-NavigatorVRDevice::NavigatorVRDevice(LocalFrame* frame)
- : DOMWindowProperty(frame)
-{
- m_hardwareUnits = new VRHardwareUnitCollection(this);
-}
-
-const char* NavigatorVRDevice::supplementName()
-{
- return "NavigatorVRDevice";
-}
-
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/vr/NavigatorVRDevice.h ('k') | third_party/WebKit/Source/modules/vr/NavigatorVRDevice.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698