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

Side by Side Diff: content/browser/media/android/media_session_uma_helper.h

Issue 1698933004: Make MediaSession a runtime-enabled feature on Desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 2015 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 CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/time/clock.h"
10 #include "content/common/content_export.h"
11
12 namespace base {
13 class Clock;
14 } // base namespace
15
16 namespace content {
17
18 class CONTENT_EXPORT MediaSessionUmaHelper {
19 public:
20 // This is used for UMA histogram (Media.Session.Suspended). New values should
21 // be appended only and must be added before |Count|.
22 enum class MediaSessionSuspendedSource {
23 SystemTransient = 0,
24 SystemPermanent = 1,
25 UI = 2,
26 CONTENT = 3,
27 SystemTransientDuck = 4,
28 Count // Leave at the end.
29 };
30
31 MediaSessionUmaHelper();
32 ~MediaSessionUmaHelper();
33
34 void RecordSessionSuspended(MediaSessionSuspendedSource source) const;
35
36 // Record the result of calling the native requestAudioFocus().
37 void RecordRequestAudioFocusResult(bool result) const;
38
39 void OnSessionActive();
40 void OnSessionSuspended();
41 void OnSessionInactive();
42
43 void SetClockForTest(scoped_ptr<base::Clock> testing_clock);
44
45 private:
46 base::TimeDelta total_active_time_;
47 base::Time current_active_time_;
48 scoped_ptr<base::Clock> clock_;
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_
OLDNEW
« no previous file with comments | « content/browser/media/android/media_session_observer.h ('k') | content/browser/media/android/media_session_uma_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698