| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_AUDIO_STREAM_MONITOR_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_AUDIO_STREAM_MONITOR_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_AUDIO_STREAM_MONITOR_H_ | 6 #define CONTENT_BROWSER_MEDIA_AUDIO_STREAM_MONITOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 StreamPollCallbackMap poll_callbacks_; | 132 StreamPollCallbackMap poll_callbacks_; |
| 133 | 133 |
| 134 // Records the last time at which sound was audible from any stream. | 134 // Records the last time at which sound was audible from any stream. |
| 135 base::TimeTicks last_blurt_time_; | 135 base::TimeTicks last_blurt_time_; |
| 136 | 136 |
| 137 // Set to true if the last call to MaybeToggle() determined the indicator | 137 // Set to true if the last call to MaybeToggle() determined the indicator |
| 138 // should be turned on. | 138 // should be turned on. |
| 139 bool was_recently_audible_; | 139 bool was_recently_audible_; |
| 140 | 140 |
| 141 // Calls Poll() at regular intervals while |poll_callbacks_| is non-empty. | 141 // Calls Poll() at regular intervals while |poll_callbacks_| is non-empty. |
| 142 base::RepeatingTimer<AudioStreamMonitor> poll_timer_; | 142 base::RepeatingTimer poll_timer_; |
| 143 | 143 |
| 144 // Started only when an indicator is toggled on, to turn it off again in the | 144 // Started only when an indicator is toggled on, to turn it off again in the |
| 145 // future. | 145 // future. |
| 146 base::OneShotTimer<AudioStreamMonitor> off_timer_; | 146 base::OneShotTimer off_timer_; |
| 147 | 147 |
| 148 DISALLOW_COPY_AND_ASSIGN(AudioStreamMonitor); | 148 DISALLOW_COPY_AND_ASSIGN(AudioStreamMonitor); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace content | 151 } // namespace content |
| 152 | 152 |
| 153 #endif // CONTENT_BROWSER_MEDIA_AUDIO_STREAM_MONITOR_H_ | 153 #endif // CONTENT_BROWSER_MEDIA_AUDIO_STREAM_MONITOR_H_ |
| OLD | NEW |