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

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

Issue 2084533008: mash: Migrate tray audio and deps to common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 6 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
« no previous file with comments | « ash/system/tray/system_tray_notifier.h ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 namespace ash { 7 namespace ash {
8 8
9 SystemTrayNotifier::SystemTrayNotifier() { 9 SystemTrayNotifier::SystemTrayNotifier() {
10 } 10 }
11 11
12 SystemTrayNotifier::~SystemTrayNotifier() { 12 SystemTrayNotifier::~SystemTrayNotifier() {
13 } 13 }
14 14
15 void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) {
16 audio_observers_.AddObserver(observer);
17 }
18
19 void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) {
20 audio_observers_.RemoveObserver(observer);
21 }
22
23 void SystemTrayNotifier::AddTracingObserver(TracingObserver* observer) { 15 void SystemTrayNotifier::AddTracingObserver(TracingObserver* observer) {
24 tracing_observers_.AddObserver(observer); 16 tracing_observers_.AddObserver(observer);
25 } 17 }
26 18
27 void SystemTrayNotifier::RemoveTracingObserver(TracingObserver* observer) { 19 void SystemTrayNotifier::RemoveTracingObserver(TracingObserver* observer) {
28 tracing_observers_.RemoveObserver(observer); 20 tracing_observers_.RemoveObserver(observer);
29 } 21 }
30 22
31 void SystemTrayNotifier::AddUserObserver(UserObserver* observer) { 23 void SystemTrayNotifier::AddUserObserver(UserObserver* observer) {
32 user_observers_.AddObserver(observer); 24 user_observers_.AddObserver(observer);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 last_window_closed_observers_.AddObserver(observer); 121 last_window_closed_observers_.AddObserver(observer);
130 } 122 }
131 123
132 void SystemTrayNotifier::RemoveLastWindowClosedObserver( 124 void SystemTrayNotifier::RemoveLastWindowClosedObserver(
133 LastWindowClosedObserver* observer) { 125 LastWindowClosedObserver* observer) {
134 last_window_closed_observers_.RemoveObserver(observer); 126 last_window_closed_observers_.RemoveObserver(observer);
135 } 127 }
136 128
137 #endif // defined(OS_CHROMEOS) 129 #endif // defined(OS_CHROMEOS)
138 130
139 void SystemTrayNotifier::NotifyAudioOutputVolumeChanged(uint64_t node_id,
140 double volume) {
141 FOR_EACH_OBSERVER(AudioObserver, audio_observers_,
142 OnOutputNodeVolumeChanged(node_id, volume));
143 }
144
145 void SystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on,
146 bool system_adjust) {
147 FOR_EACH_OBSERVER(AudioObserver, audio_observers_,
148 OnOutputMuteChanged(mute_on, system_adjust));
149 }
150
151 void SystemTrayNotifier::NotifyAudioNodesChanged() {
152 FOR_EACH_OBSERVER(
153 AudioObserver,
154 audio_observers_,
155 OnAudioNodesChanged());
156 }
157
158 void SystemTrayNotifier::NotifyAudioActiveOutputNodeChanged() {
159 FOR_EACH_OBSERVER(
160 AudioObserver,
161 audio_observers_,
162 OnActiveOutputNodeChanged());
163 }
164
165 void SystemTrayNotifier::NotifyAudioActiveInputNodeChanged() {
166 FOR_EACH_OBSERVER(
167 AudioObserver,
168 audio_observers_,
169 OnActiveInputNodeChanged());
170 }
171
172 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) { 131 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) {
173 FOR_EACH_OBSERVER( 132 FOR_EACH_OBSERVER(
174 TracingObserver, 133 TracingObserver,
175 tracing_observers_, 134 tracing_observers_,
176 OnTracingModeChanged(value)); 135 OnTracingModeChanged(value));
177 } 136 }
178 137
179 void SystemTrayNotifier::NotifyUserUpdate() { 138 void SystemTrayNotifier::NotifyUserUpdate() {
180 FOR_EACH_OBSERVER(UserObserver, 139 FOR_EACH_OBSERVER(UserObserver,
181 user_observers_, 140 user_observers_,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 233
275 void SystemTrayNotifier::NotifyLastWindowClosed() { 234 void SystemTrayNotifier::NotifyLastWindowClosed() {
276 FOR_EACH_OBSERVER(LastWindowClosedObserver, 235 FOR_EACH_OBSERVER(LastWindowClosedObserver,
277 last_window_closed_observers_, 236 last_window_closed_observers_,
278 OnLastWindowClosed()); 237 OnLastWindowClosed());
279 } 238 }
280 239
281 #endif // OS_CHROMEOS 240 #endif // OS_CHROMEOS
282 241
283 } // namespace ash 242 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_notifier.h ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698