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

Side by Side Diff: third_party/WebKit/Source/core/html/AutoplayUmaHelper.h

Issue 2108403003: Measure whether muted videos that started playing with play() become visible at some point (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: this one is ready Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef AutoplayUmaHelper_h
6 #define AutoplayUmaHelper_h
7
8 #include "platform/heap/Handle.h"
9
10 namespace blink {
11
12 // These values are used for histograms. Do not reorder.
13 enum class AutoplaySource {
14 // Autoplay comes from HTMLMediaElement `autoplay` attribute.
15 Attribute = 0,
16 // Autoplay comes from `play()` method.
17 Method = 1,
18 // This enum value must be last.
19 NumberOfSources = 2,
20 };
21
22 class HTMLMediaElement;
23
24 class AutoplayUmaHelper final : public GarbageCollectedFinalized<AutoplayUmaHelp er> {
25
26 public:
27
28 static AutoplayUmaHelper* create(HTMLMediaElement* element)
29 {
30 return new AutoplayUmaHelper(element);
31 }
32
33 ~AutoplayUmaHelper();
34
35 void onAutoplayInitiated(AutoplaySource);
36 void onAutoplayStarted();
37 void onElementDestroyed();
38
39 DECLARE_TRACE();
40
41 private:
42 explicit AutoplayUmaHelper(HTMLMediaElement*);
43
44 // The autoplay source. Use AutoplaySource::NumberOfSources for invalid sour ce.
45 AutoplaySource m_source;
46 WeakMember<HTMLMediaElement> m_element;
47 };
48
49 } // namespace blink
50
51 #endif // AutoplayUmaHelper_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698