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

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

Issue 2505493004: Wired up vrdisplayactivate/deactivate (Closed)
Patch Set: Again with the upstream issues Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplayEvent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/vr/VRDisplayEvent.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplayEvent.cpp b/third_party/WebKit/Source/modules/vr/VRDisplayEvent.cpp
index 9e8d5d684a6cc0911a7073a42cea8838d64a8147..f05e6d0a53175c66de5b694d4c9c0a7e10803ef9 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplayEvent.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplayEvent.cpp
@@ -6,6 +6,37 @@
namespace blink {
+namespace {
+
+String VRDisplayEventReasonToString(
+ device::mojom::blink::VRDisplayEventReason reason) {
+ switch (reason) {
+ case device::mojom::blink::VRDisplayEventReason::NONE:
+ return "";
+ case device::mojom::blink::VRDisplayEventReason::NAVIGATION:
+ return "navigation";
+ case device::mojom::blink::VRDisplayEventReason::MOUNTED:
+ return "mounted";
+ case device::mojom::blink::VRDisplayEventReason::UNMOUNTED:
+ return "unmounted";
+ }
+
+ NOTREACHED();
+ return "";
+}
+
+} // namespace
+
+VRDisplayEvent* VRDisplayEvent::create(
+ const AtomicString& type,
+ bool canBubble,
+ bool cancelable,
+ VRDisplay* display,
+ device::mojom::blink::VRDisplayEventReason reason) {
+ return new VRDisplayEvent(type, canBubble, cancelable, display,
+ VRDisplayEventReasonToString(reason));
+}
+
VRDisplayEvent::VRDisplayEvent() {}
VRDisplayEvent::VRDisplayEvent(const AtomicString& type,
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplayEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698