Chromium Code Reviews| Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| index 31fbc5f152979223fcafbeaa97bdcbe2648c76b2..5122c99d42d313daa98f7a7ad95c259908966e61 100644 |
| --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
| @@ -220,6 +220,14 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state, |
| return promise; |
| } |
| + // When we are requesting to start presentation with a user action or the |
| + // display has activated, record the user action. |
| + if (first_present && |
|
mthiesse
2017/05/10 14:58:13
Why duplicate the logic for when we should (usuall
billorr
2017/05/10 18:47:13
I'm trying to filter calls of "requestPresent" to
|
| + (UserGestureIndicator::ProcessingUserGesture() || in_display_activate_)) { |
| + Platform::Current()->RecordAction( |
| + UserMetricsAction("VR.WebVR.requestPresent")); |
| + } |
| + |
| // A valid number of layers must be provided in order to present. |
| if (layers.size() == 0 || layers.size() > capabilities_->maxLayers()) { |
| ForceExitPresent(); |
| @@ -671,7 +679,13 @@ void VRDisplay::StopPresenting() { |
| // Can't get into this presentation mode, so nothing to do here. |
| } |
| is_presenting_ = false; |
| + |
| OnPresentChange(); |
| + |
| + // Record user action for stop presenting. Note that this could be |
| + // user-triggered or not. |
| + Platform::Current()->RecordAction( |
| + UserMetricsAction("VR.WebVR.StopPresenting")); |
| } |
| rendering_context_ = nullptr; |