| 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 CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/clock.h" | 9 #include "base/time/clock.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 UI = 2, | 25 UI = 2, |
| 26 CONTENT = 3, | 26 CONTENT = 3, |
| 27 Count // Leave at the end. | 27 Count // Leave at the end. |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 MediaSessionUmaHelper(); | 30 MediaSessionUmaHelper(); |
| 31 ~MediaSessionUmaHelper(); | 31 ~MediaSessionUmaHelper(); |
| 32 | 32 |
| 33 void RecordSessionSuspended(MediaSessionSuspendedSource source) const; | 33 void RecordSessionSuspended(MediaSessionSuspendedSource source) const; |
| 34 | 34 |
| 35 // Record the result of calling the native requestAudioFocus(). |
| 36 void RecordRequestAudioFocusResult(bool result) const; |
| 37 |
| 35 void OnSessionActive(); | 38 void OnSessionActive(); |
| 36 void OnSessionSuspended(); | 39 void OnSessionSuspended(); |
| 37 void OnSessionInactive(); | 40 void OnSessionInactive(); |
| 38 | 41 |
| 39 void SetClockForTest(scoped_ptr<base::Clock> testing_clock); | 42 void SetClockForTest(scoped_ptr<base::Clock> testing_clock); |
| 40 | 43 |
| 41 private: | 44 private: |
| 42 base::TimeDelta total_active_time_; | 45 base::TimeDelta total_active_time_; |
| 43 base::Time current_active_time_; | 46 base::Time current_active_time_; |
| 44 scoped_ptr<base::Clock> clock_; | 47 scoped_ptr<base::Clock> clock_; |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 } // namespace content | 50 } // namespace content |
| 48 | 51 |
| 49 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_ | 52 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_ |
| OLD | NEW |