Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| index 7fa17e2b42c67ae4901a253a4c08bc9aabcc3cd6..ca4f359316b3defde3417bdb248efa20574b8c30 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| @@ -130,6 +130,7 @@ constexpr float kMostlyFillViewportThreshold = 0.85f; |
| constexpr double kMostlyFillViewportBecomeStableSeconds = 5; |
| constexpr double kCheckViewportIntersectionIntervalSeconds = 1; |
| +// This enum is used to record histograms. Do not reorder. |
| enum MediaControlsShow { |
| MediaControlsShowAttribute = 0, |
| MediaControlsShowFullscreen, |
| @@ -139,6 +140,13 @@ enum MediaControlsShow { |
| MediaControlsShowMax |
| }; |
| +// This enum is used to record histograms. Do not reorder. |
| +enum VideoPersistenceControlsType { |
| + VideoPersistenceControlsTypeNative = 0, |
| + VideoPersistenceControlsTypeCustom, |
| + VideoPersistenceControlsTypeMax |
|
Ilya Sherman
2017/03/20 19:08:39
Optional nit: Typically, this would be named "Coun
Zhiqiang Zhang (Slow)
2017/03/20 21:29:15
Or name it "NumberOfTypes"?
Also, use "enum class"
mlamouri (slow - plz ping)
2017/03/21 12:01:21
Named it Count as per isherman@ request. I would l
|
| +}; |
| + |
| String urlForLoggingMedia(const KURL& url) { |
| static const unsigned maximumURLLengthForLogging = 128; |
| @@ -3242,6 +3250,17 @@ void HTMLMediaElement::onBecamePersistentVideo(bool value) { |
| return; |
| if (value) { |
| + // Record the type of video. If it is already fullscreen, it is a video with |
| + // native controls, otherwise it is assumed to be with custom controls. |
| + // This is only recorded when entering this mode. |
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, histogram, |
| + ("Media.VideoPersistence.ControlsType", |
| + VideoPersistenceControlsTypeMax)); |
| + if (isFullscreen()) |
| + histogram.count(VideoPersistenceControlsTypeNative); |
| + else |
| + histogram.count(VideoPersistenceControlsTypeCustom); |
| + |
| if (isFullscreen()) |
| return; |