Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_usage_monitor.h |
| diff --git a/chrome/browser/android/vr_shell/vr_usage_monitor.h b/chrome/browser/android/vr_shell/vr_usage_monitor.h |
| index 594f34841f07235fb3327585e4050f6857269520..5c9205b1e12a5ea5c2a662951a3cf26ca0353787 100644 |
| --- a/chrome/browser/android/vr_shell/vr_usage_monitor.h |
| +++ b/chrome/browser/android/vr_shell/vr_usage_monitor.h |
| @@ -12,6 +12,8 @@ |
| #include "content/public/browser/navigation_handle.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_observer.h" |
| +#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h" |
|
billorr
2017/05/05 17:48:41
We should try to keep gvr-related code limited to
tiborg
2017/05/05 19:03:34
Good point. What about putting an #ifdef ANDROID a
billorr
2017/05/05 20:10:21
#ifdef could work, or the histograms could be move
tiborg
2017/05/10 20:39:52
I put an #ifdef guard around it.
Also, moved the
|
| +#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" |
| namespace vr_shell { |
| @@ -53,6 +55,44 @@ class SessionTimer { |
| DISALLOW_COPY_AND_ASSIGN(SessionTimer); |
| }; |
| +enum class ViewerType { |
| + UNKNOWN_TYPE = 0, |
| + CARDBOARD = 1, |
| + DAYDREAM = 2, |
| + VIEWER_TYPE_MAX, |
| +}; |
| + |
| +enum class GVRVersionCrossedVRViewerType { |
| + |
| + GVR_OLDER_AND_UNKNOWN_TYPE = 0, |
|
ddorwin
2017/05/05 20:29:59
Does unknown == not selected? Do we need the GVR u
tiborg
2017/05/10 20:39:52
It's gone. See comment below.
|
| + GVR_1_10_AND_UNKNOWN_TYPE = 1, |
| + GVR_1_20_AND_UNKNOWN_TYPE = 2, |
| + GVR_1_30_AND_UNKNOWN_TYPE = 3, |
| + GVR_1_40_AND_UNKNOWN_TYPE = 4, |
| + GVR_NEWER_AND_UNKNOWN_TYPE = 5, |
| + GVR_OTHER_AND_UNKNOWN_TYPE = 6, |
| + |
| + GVR_OLDER_AND_CARDBOARD = 7, |
| + GVR_1_10_AND_CARDBOARD = 8, |
| + GVR_1_20_AND_CARDBOARD = 9, |
| + GVR_1_30_AND_CARDBOARD = 10, |
| + GVR_1_40_AND_CARDBOARD = 11, |
| + GVR_NEWER_AND_CARDBOARD = 12, |
|
billorr
2017/05/05 17:48:41
what is the plan when newer versions come out? do
tiborg
2017/05/05 19:03:35
Putting the GVR version in the metadata is probabl
billorr
2017/05/05 20:10:21
indeed.
One minor thing we could do to make it ea
ddorwin
2017/05/05 20:29:59
We should definitely be able to report versions be
tiborg
2017/05/10 20:39:52
Ok, these are good points. As discussed offline, c
|
| + GVR_OTHER_AND_CARDBOARD = 13, |
| + |
| + GVR_OLDER_AND_DAYDREAM = 14, |
| + GVR_1_10_AND_DAYDREAM = 15, |
| + GVR_1_20_AND_DAYDREAM = 16, |
| + GVR_1_30_AND_DAYDREAM = 17, |
| + GVR_1_40_AND_DAYDREAM = 18, |
| + GVR_NEWER_AND_DAYDREAM = 19, |
| + GVR_OTHER_AND_DAYDREAM = 20, |
| + |
| + GVR_NONE = 21, |
| + |
| + GVR_VERSION_CROSSED_VR_VIEWER_TYPE_MAX, |
| +}; |
| + |
| // This class is not threadsafe and must only be used from the main thread. |
| class VrMetricsHelper : public content::WebContentsObserver { |
| public: |
| @@ -61,6 +101,10 @@ class VrMetricsHelper : public content::WebContentsObserver { |
| void SetWebVREnabled(bool is_webvr_presenting); |
| void SetVRActive(bool is_vr_enabled); |
| + static void LogGvrVersionAndVrViewerType(gvr_context* context, |
| + gvr_version version); |
| + static void LogVrViewerType(gvr_context* context); |
| + |
| private: |
| // WebContentObserver |
| void MediaStartedPlaying(const MediaPlayerInfo& media_info, |
| @@ -74,6 +118,8 @@ class VrMetricsHelper : public content::WebContentsObserver { |
| void SetVrMode(VRMode mode); |
| void UpdateMode(); |
| + static ViewerType GetVrViewerType(gvr_context* context); |
| + |
| std::unique_ptr<SessionTimer> mode_video_timer_; |
| std::unique_ptr<SessionTimer> session_video_timer_; |
| std::unique_ptr<SessionTimer> mode_timer_; |
| @@ -90,6 +136,8 @@ class VrMetricsHelper : public content::WebContentsObserver { |
| int num_session_navigation_ = 0; |
| int num_session_video_playback_ = 0; |
| + static bool logged_gvr_version_; |
| + |
| GURL origin_; |
| }; |