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

Side by Side Diff: ash/system/tray/system_tray_notifier.cc

Issue 163953007: Refactor the TrayAudio code so that it can be used by other platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak by using scoped_ptr in TrayAudio Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "ash/system/tray/system_tray_notifier.h" 5 #include "ash/system/tray/system_tray_notifier.h"
6 6
7 #if defined(OS_CHROMEOS) 7 #if defined(OS_CHROMEOS)
8 #include "ash/system/chromeos/network/network_state_notifier.h" 8 #include "ash/system/chromeos/network/network_state_notifier.h"
9 #endif 9 #endif
10 10
(...skipping 11 matching lines...) Expand all
22 void SystemTrayNotifier::AddAccessibilityObserver( 22 void SystemTrayNotifier::AddAccessibilityObserver(
23 AccessibilityObserver* observer) { 23 AccessibilityObserver* observer) {
24 accessibility_observers_.AddObserver(observer); 24 accessibility_observers_.AddObserver(observer);
25 } 25 }
26 26
27 void SystemTrayNotifier::RemoveAccessibilityObserver( 27 void SystemTrayNotifier::RemoveAccessibilityObserver(
28 AccessibilityObserver* observer) { 28 AccessibilityObserver* observer) {
29 accessibility_observers_.RemoveObserver(observer); 29 accessibility_observers_.RemoveObserver(observer);
30 } 30 }
31 31
32 void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) {
33 audio_observers_.AddObserver(observer);
34 }
35
36 void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) {
37 audio_observers_.RemoveObserver(observer);
38 }
39
32 void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) { 40 void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) {
33 bluetooth_observers_.AddObserver(observer); 41 bluetooth_observers_.AddObserver(observer);
34 } 42 }
35 43
36 void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) { 44 void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) {
37 bluetooth_observers_.RemoveObserver(observer); 45 bluetooth_observers_.RemoveObserver(observer);
38 } 46 }
39 47
40 void SystemTrayNotifier::AddCapsLockObserver(CapsLockObserver* observer) { 48 void SystemTrayNotifier::AddCapsLockObserver(CapsLockObserver* observer) {
41 caps_lock_observers_.AddObserver(observer); 49 caps_lock_observers_.AddObserver(observer);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 #endif 171 #endif
164 172
165 void SystemTrayNotifier::NotifyAccessibilityModeChanged( 173 void SystemTrayNotifier::NotifyAccessibilityModeChanged(
166 AccessibilityNotificationVisibility notify) { 174 AccessibilityNotificationVisibility notify) {
167 FOR_EACH_OBSERVER( 175 FOR_EACH_OBSERVER(
168 AccessibilityObserver, 176 AccessibilityObserver,
169 accessibility_observers_, 177 accessibility_observers_,
170 OnAccessibilityModeChanged(notify)); 178 OnAccessibilityModeChanged(notify));
171 } 179 }
172 180
181 void SystemTrayNotifier::NotifyAudioOutputVolumeChanged() {
182 FOR_EACH_OBSERVER(
183 AudioObserver,
184 audio_observers_,
185 OnOutputVolumeChanged());
186 }
187
188 void SystemTrayNotifier::NotifyAudioOutputMuteChanged() {
189 FOR_EACH_OBSERVER(
190 AudioObserver,
191 audio_observers_,
192 OnOutputMuteChanged());
193 }
194
195 void SystemTrayNotifier::NotifyAudioNodesChanged() {
196 FOR_EACH_OBSERVER(
197 AudioObserver,
198 audio_observers_,
199 OnAudioNodesChanged());
200 }
201
202 void SystemTrayNotifier::NotifyAudioActiveOutputNodeChanged() {
203 FOR_EACH_OBSERVER(
204 AudioObserver,
205 audio_observers_,
206 OnActiveOutputNodeChanged());
207 }
208
209 void SystemTrayNotifier::NotifyAudioActiveInputNodeChanged() {
210 FOR_EACH_OBSERVER(
211 AudioObserver,
212 audio_observers_,
213 OnActiveInputNodeChanged());
214 }
215
173 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) { 216 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) {
174 FOR_EACH_OBSERVER( 217 FOR_EACH_OBSERVER(
175 TracingObserver, 218 TracingObserver,
176 tracing_observers_, 219 tracing_observers_,
177 OnTracingModeChanged(value)); 220 OnTracingModeChanged(value));
178 } 221 }
179 222
180 void SystemTrayNotifier::NotifyRefreshBluetooth() { 223 void SystemTrayNotifier::NotifyRefreshBluetooth() {
181 FOR_EACH_OBSERVER(BluetoothObserver, 224 FOR_EACH_OBSERVER(BluetoothObserver,
182 bluetooth_observers_, 225 bluetooth_observers_,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 357 }
315 358
316 void SystemTrayNotifier::NotifyScreenShareStop() { 359 void SystemTrayNotifier::NotifyScreenShareStop() {
317 FOR_EACH_OBSERVER(ScreenShareObserver, screen_share_observers_, 360 FOR_EACH_OBSERVER(ScreenShareObserver, screen_share_observers_,
318 OnScreenShareStop()); 361 OnScreenShareStop());
319 } 362 }
320 363
321 #endif // OS_CHROMEOS 364 #endif // OS_CHROMEOS
322 365
323 } // namespace ash 366 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_notifier.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698