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

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

Issue 2867093005: Add UMA metrics to track user action sequence in VR (Closed)
Patch Set: uncomment assert Created 3 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/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;
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698