Index: third_party/WebKit/Source/modules/vr/VRController.cpp |
diff --git a/third_party/WebKit/Source/modules/vr/VRController.cpp b/third_party/WebKit/Source/modules/vr/VRController.cpp |
index bc92c33ec8f19e1640dee2cab9506620a542cbe6..436767e38039af013dda345f1164c46e58bc8d91 100644 |
--- a/third_party/WebKit/Source/modules/vr/VRController.cpp |
+++ b/third_party/WebKit/Source/modules/vr/VRController.cpp |
@@ -115,6 +115,28 @@ void VRController::OnDisplayChanged(device::blink::VRDisplayPtr display) |
vrDisplay->update(display); |
} |
+void VRController::OnDisplayConnected(device::blink::VRDisplayPtr display) |
+{ |
+ VRDisplay* vrDisplay = createOrUpdateDisplay(display); |
+ if (!vrDisplay) |
+ return; |
+ |
+ m_navigatorVR->fireVREvent(VRDisplayEvent::create( |
+ EventTypeNames::vrdisplayconnect, true, false, vrDisplay, "connect")); |
+} |
+ |
+void VRController::OnDisplayDisconnected(unsigned index) |
+{ |
+ VRDisplay* vrDisplay = getDisplayForIndex(index); |
+ if (!vrDisplay) |
+ return; |
+ |
+ vrDisplay->disconnected(); |
+ |
+ m_navigatorVR->fireVREvent(VRDisplayEvent::create( |
+ EventTypeNames::vrdisplaydisconnect, true, false, vrDisplay, "disconnect")); |
+} |
+ |
void VRController::contextDestroyed() |
{ |
// If the document context was destroyed, shut down the client connection |