OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 AutoplayExperimentHelper_h | 5 #ifndef AutoplayExperimentHelper_h |
6 #define AutoplayExperimentHelper_h | 6 #define AutoplayExperimentHelper_h |
7 | 7 |
8 #include "core/page/PageVisibilityState.h" | 8 #include "core/page/PageVisibilityState.h" |
9 #include "platform/Timer.h" | 9 #include "platform/Timer.h" |
10 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // Record that an attempt to play without a user gesture has happened. | 259 // Record that an attempt to play without a user gesture has happened. |
260 // This does not assume whether or not the play attempt will succeed. | 260 // This does not assume whether or not the play attempt will succeed. |
261 // This method takes no action after it is called once. | 261 // This method takes no action after it is called once. |
262 void autoplayMediaEncountered(); | 262 void autoplayMediaEncountered(); |
263 | 263 |
264 // If we are about to enter a paused state, call this to record | 264 // If we are about to enter a paused state, call this to record |
265 // autoplay metrics. | 265 // autoplay metrics. |
266 void recordMetricsBeforePause(); | 266 void recordMetricsBeforePause(); |
267 | 267 |
268 // Process a timer for checking visibility. | 268 // Process a timer for checking visibility. |
269 void viewportTimerFired(Timer<AutoplayExperimentHelper>*); | 269 void viewportTimerFired(TimerBase*); |
270 | 270 |
271 Client& client() const { return *m_client; } | 271 Client& client() const { return *m_client; } |
272 | 272 |
273 bool isLockedPendingUserGesture() const; | 273 bool isLockedPendingUserGesture() const; |
274 | 274 |
275 inline bool enabled(Mode mode) const | 275 inline bool enabled(Mode mode) const |
276 { | 276 { |
277 return static_cast<int>(m_mode) & static_cast<int>(mode); | 277 return static_cast<int>(m_mode) & static_cast<int>(mode); |
278 } | 278 } |
279 | 279 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 inline AutoplayExperimentHelper::Mode& operator|=(AutoplayExperimentHelper::Mode
& a, | 337 inline AutoplayExperimentHelper::Mode& operator|=(AutoplayExperimentHelper::Mode
& a, |
338 const AutoplayExperimentHelper::Mode& b) | 338 const AutoplayExperimentHelper::Mode& b) |
339 { | 339 { |
340 a = static_cast<AutoplayExperimentHelper::Mode>(static_cast<int>(a) | static
_cast<int>(b)); | 340 a = static_cast<AutoplayExperimentHelper::Mode>(static_cast<int>(a) | static
_cast<int>(b)); |
341 return a; | 341 return a; |
342 } | 342 } |
343 | 343 |
344 } // namespace blink | 344 } // namespace blink |
345 | 345 |
346 #endif // AutoplayExperimentHelper_h | 346 #endif // AutoplayExperimentHelper_h |
OLD | NEW |