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

Side by Side Diff: content/browser/media/audio_state_provider.h

Issue 1215713021: Reverted the code for the non-interactive audible tab notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification
Patch Set: Fixed indent Created 5 years, 3 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_AUDIO_STATE_PROVIDER_H_
6 #define CONTENT_BROWSER_MEDIA_AUDIO_STATE_PROVIDER_H_
7
8 #include "content/common/content_export.h"
9
10 namespace content {
11 class WebContents;
12 class AudioStreamMonitor;
13
14 // This class is associated with a WebContents, and maintains the audible
15 // state regarding all the players in it.
16 // The audible state is true if at least one player is playing a sound.
17 // Whenever the audible state of the WebContents as a whole changes, this
18 // class sends a notification to it.
19 //
20 // Each WebContentsImpl owns an AudioStateProvider
21 class CONTENT_EXPORT AudioStateProvider {
22 public:
23 explicit AudioStateProvider(WebContents* web_contents);
24 virtual ~AudioStateProvider() {}
25
26 // Indicates whether this service is available on the system.
27 virtual bool IsAudioStateAvailable() const = 0;
28
29 // If this provider uses monitoring (i.e. measure the signal),
30 // return its monitor.
31 virtual AudioStreamMonitor* audio_stream_monitor() = 0;
32
33 // Returns true if the WebContents is playing or has recently been
34 // playing the sound.
35 virtual bool WasRecentlyAudible() const;
36
37 void set_was_recently_audible_for_testing(bool value) {
38 was_recently_audible_ = value;
39 }
40
41 protected:
42 // Notify WebContents that the audio state has changed.
43 void Notify(bool new_state);
44
45 // The WebContents instance instance to receive indicator toggle
46 // notifications. This pointer should be valid for the lifetime of
47 // AudioStreamMonitor.
48 WebContents* const web_contents_;
49
50 // The audio state that is being maintained
51 bool was_recently_audible_;
52
53 };
54
55 } // namespace content
56
57 #endif // CONTENT_BROWSER_MEDIA_AUDIO_STATE_PROVIDER_H_
OLDNEW
« no previous file with comments | « content/browser/media/android/browser_media_player_manager.cc ('k') | content/browser/media/audio_state_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698