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

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

Issue 11312139: Add SystemTrayObservers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment. Created 8 years, 1 month 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
« no previous file with comments | « ash/system/tray/system_tray_notifier.h ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/system/tray/system_tray_notifier.h"
6
7 namespace ash {
8
9 SystemTrayNotifier::SystemTrayNotifier() {
10 }
11
12 SystemTrayNotifier::~SystemTrayNotifier() {
13 }
14
15 void SystemTrayNotifier::AddAccessibilityObserver(
16 AccessibilityObserver* observer) {
17 accessibility_observers_.AddObserver(observer);
18 }
19
20 void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) {
21 audio_observers_.AddObserver(observer);
22 }
23
24 void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) {
25 bluetooth_observers_.AddObserver(observer);
26 }
27
28 void SystemTrayNotifier::AddBrightnessObserver(BrightnessObserver* observer) {
29 brightness_observers_.AddObserver(observer);
30 }
31
32 void SystemTrayNotifier::AddCapsLockObserver(CapsLockObserver* observer) {
33 caps_lock_observers_.AddObserver(observer);
34 }
35
36 void SystemTrayNotifier::AddClockObserver(ClockObserver* observer) {
37 clock_observers_.AddObserver(observer);
38 }
39
40 void SystemTrayNotifier::AddDriveObserver(DriveObserver* observer) {
41 drive_observers_.AddObserver(observer);
42 }
43
44 void SystemTrayNotifier::AddIMEObserver(IMEObserver* observer) {
45 ime_observers_.AddObserver(observer);
46 }
47
48 void SystemTrayNotifier::AddLocaleObserver(LocaleObserver* observer) {
49 locale_observers_.AddObserver(observer);
50 }
51
52 void SystemTrayNotifier::AddLogoutButtonObserver(
53 LogoutButtonObserver* observer) {
54 logout_button_observers_.AddObserver(observer);
55 }
56
57 void SystemTrayNotifier::AddPowerStatusObserver(
58 PowerStatusObserver* observer) {
59 power_status_observers_.AddObserver(observer);
60 }
61
62 void SystemTrayNotifier::AddUpdateObserver(UpdateObserver* observer) {
63 update_observers_.AddObserver(observer);
64 }
65
66 void SystemTrayNotifier::AddUserObserver(UserObserver* observer) {
67 user_observers_.AddObserver(observer);
68 }
69
70 #if defined(OS_CHROMEOS)
71 void SystemTrayNotifier::AddNetworkObserver(NetworkObserver* observer) {
72 network_observers_.AddObserver(observer);
73 }
74
75 void SystemTrayNotifier::AddVpnObserver(NetworkObserver* observer) {
76 vpn_observers_.AddObserver(observer);
77 }
78
79 void SystemTrayNotifier::AddSmsObserver(SmsObserver* observer) {
80 sms_observers_.AddObserver(observer);
81 }
82 #endif
83
84 void SystemTrayNotifier::NotifyAccessibilityModeChanged(
85 bool spoken_feedback_enabled) {
86 FOR_EACH_OBSERVER(
87 AccessibilityObserver,
88 accessibility_observers_,
89 OnAccessibilityModeChanged(spoken_feedback_enabled));
90 }
91
92 void SystemTrayNotifier::NotifyVolumeChanged(float level) {
93 FOR_EACH_OBSERVER(AudioObserver,
94 audio_observers_,
95 OnVolumeChanged(level));
96 }
97
98 void SystemTrayNotifier::NotifyMuteToggled() {
99 FOR_EACH_OBSERVER(AudioObserver,
100 audio_observers_,
101 OnMuteToggled());
102 }
103
104 void SystemTrayNotifier::NotifyRefreshBluetooth() {
105 FOR_EACH_OBSERVER(BluetoothObserver,
106 bluetooth_observers_,
107 OnBluetoothRefresh());
108 }
109
110 void SystemTrayNotifier::NotifyBluetoothDiscoveringChanged() {
111 FOR_EACH_OBSERVER(BluetoothObserver,
112 bluetooth_observers_,
113 OnBluetoothDiscoveringChanged());
114 }
115
116 void SystemTrayNotifier::NotifyBrightnessChanged(double level,
117 bool user_initiated) {
118 FOR_EACH_OBSERVER(
119 BrightnessObserver,
120 brightness_observers_,
121 OnBrightnessChanged(level, user_initiated));
122 }
123
124 void SystemTrayNotifier::NotifyCapsLockChanged(
125 bool enabled,
126 bool search_mapped_to_caps_lock) {
127 FOR_EACH_OBSERVER(CapsLockObserver,
128 caps_lock_observers_,
129 OnCapsLockChanged(enabled, search_mapped_to_caps_lock));
130 }
131
132 void SystemTrayNotifier::NotifyRefreshClock() {
133 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh());
134 }
135
136 void SystemTrayNotifier::NotifyDateFormatChanged() {
137 FOR_EACH_OBSERVER(ClockObserver,
138 clock_observers_,
139 OnDateFormatChanged());
140 }
141
142 void SystemTrayNotifier::NotifyRefreshDrive(DriveOperationStatusList& list) {
143 FOR_EACH_OBSERVER(DriveObserver,
144 drive_observers_,
145 OnDriveRefresh(list));
146 }
147
148 void SystemTrayNotifier::NotifyRefreshIME(bool show_message) {
149 FOR_EACH_OBSERVER(IMEObserver,
150 ime_observers_,
151 OnIMERefresh(show_message));
152 }
153
154 void SystemTrayNotifier::NotifyShowLoginButtonChanged(bool show_login_button) {
155 FOR_EACH_OBSERVER(LogoutButtonObserver,
156 logout_button_observers_,
157 OnShowLogoutButtonInTrayChanged(show_login_button));
158 }
159
160 void SystemTrayNotifier::NotifyLocaleChanged(
161 LocaleObserver::Delegate* delegate,
162 const std::string& cur_locale,
163 const std::string& from_locale,
164 const std::string& to_locale) {
165 FOR_EACH_OBSERVER(
166 LocaleObserver,
167 locale_observers_,
168 OnLocaleChanged(delegate, cur_locale, from_locale, to_locale));
169 }
170
171 void SystemTrayNotifier::NotifyPowerStatusChanged(
172 const PowerSupplyStatus& power_status) {
173 FOR_EACH_OBSERVER(PowerStatusObserver,
174 power_status_observers_,
175 OnPowerStatusChanged(power_status));
176 }
177
178 void SystemTrayNotifier::NotifyUpdateRecommended(
179 UpdateObserver::UpdateSeverity severity) {
180 FOR_EACH_OBSERVER(UpdateObserver,
181 update_observers_,
182 OnUpdateRecommended(severity));
183 }
184
185 void SystemTrayNotifier::NotifyUserUpdate() {
186 FOR_EACH_OBSERVER(UserObserver,
187 user_observers_,
188 OnUserUpdate());
189 }
190
191 #if defined(OS_CHROMEOS)
192
193 void SystemTrayNotifier::NotifyRefreshNetwork(const NetworkIconInfo &info) {
194 FOR_EACH_OBSERVER(NetworkObserver,
195 network_observers_,
196 OnNetworkRefresh(info));
197 }
198
199 void SystemTrayNotifier::NotifySetNetworkMessage(
200 NetworkTrayDelegate* delegate,
201 NetworkObserver::MessageType message_type,
202 const string16& title,
203 const string16& message,
204 const std::vector<string16>& links) {
205 FOR_EACH_OBSERVER(NetworkObserver,
206 network_observers_,
207 SetNetworkMessage(
208 delegate, message_type, title, message, links));
209 }
210
211 void SystemTrayNotifier::NotifyClearNetworkMessage(
212 NetworkObserver::MessageType message_type) {
213 FOR_EACH_OBSERVER(NetworkObserver,
214 network_observers_,
215 ClearNetworkMessage(message_type));
216 }
217
218 void SystemTrayNotifier::NotifyVpnRefreshNetwork(const NetworkIconInfo &info) {
219 FOR_EACH_OBSERVER(NetworkObserver,
220 vpn_observers_,
221 OnNetworkRefresh(info));
222 }
223
224 void SystemTrayNotifier::NotifyWillToggleWifi() {
225 FOR_EACH_OBSERVER(NetworkObserver,
226 network_observers_,
227 OnWillToggleWifi());
228 }
229
230 void SystemTrayNotifier::NotifyAddSmsMessage(
231 const base::DictionaryValue& message) {
232 FOR_EACH_OBSERVER(SmsObserver, sms_observers_, AddMessage(message));
233 }
234
235 #endif // OS_CHROMEOS
236
237 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_notifier.h ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698