OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef AutoplayPolicy_h | 5 #ifndef AutoplayPolicy_h |
6 #define AutoplayPolicy_h | 6 #define AutoplayPolicy_h |
7 | 7 |
8 #include "bindings/core/v8/Nullable.h" | 8 #include "bindings/core/v8/Nullable.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Unlock user gesture if a user gesture can be utilized. | 50 // Unlock user gesture if a user gesture can be utilized. |
51 void TryUnlockingUserGesture(); | 51 void TryUnlockingUserGesture(); |
52 | 52 |
53 // Return true if and only if a user gesture is requried for playback. Even | 53 // Return true if and only if a user gesture is requried for playback. Even |
54 // if isLockedPendingUserGesture() return true, this might return false if | 54 // if isLockedPendingUserGesture() return true, this might return false if |
55 // the requirement is currently overridden. This does not check if a user | 55 // the requirement is currently overridden. This does not check if a user |
56 // gesture is currently being processed. | 56 // gesture is currently being processed. |
57 bool IsGestureNeededForPlayback() const; | 57 bool IsGestureNeededForPlayback() const; |
58 | 58 |
| 59 // Called when source is initialized and loading starts. |
| 60 void OnLoadStarted(); |
| 61 |
59 DECLARE_VIRTUAL_TRACE(); | 62 DECLARE_VIRTUAL_TRACE(); |
60 | 63 |
61 private: | 64 private: |
62 friend class AutoplayUmaHelper; | 65 friend class AutoplayUmaHelper; |
63 friend class AutoplayUmaHelperTest; | 66 friend class AutoplayUmaHelperTest; |
64 | 67 |
65 // Start autoplaying the video element whenever its visible. | 68 // Start autoplaying the video element whenever its visible. |
66 void StartAutoplayMutedWhenVisible(); | 69 void StartAutoplayMutedWhenVisible(); |
67 | 70 |
68 // Returns whether the media element is eligible to autoplay muted. | 71 // Returns whether the media element is eligible to autoplay muted. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 Member<ElementVisibilityObserver> autoplay_visibility_observer_; | 107 Member<ElementVisibilityObserver> autoplay_visibility_observer_; |
105 | 108 |
106 Member<AutoplayUmaHelper> autoplay_uma_helper_; | 109 Member<AutoplayUmaHelper> autoplay_uma_helper_; |
107 | 110 |
108 DISALLOW_COPY_AND_ASSIGN(AutoplayPolicy); | 111 DISALLOW_COPY_AND_ASSIGN(AutoplayPolicy); |
109 }; | 112 }; |
110 | 113 |
111 } // namespace blink | 114 } // namespace blink |
112 | 115 |
113 #endif // AutoplayPolicy_h | 116 #endif // AutoplayPolicy_h |
OLD | NEW |