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

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

Issue 2086503003: mash: Migrate tray IME view to wm common types, move to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@movea11y
Patch Set: nit 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/virtual_keyboard_controller.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) { 15 void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) {
16 audio_observers_.AddObserver(observer); 16 audio_observers_.AddObserver(observer);
17 } 17 }
18 18
19 void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) { 19 void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) {
20 audio_observers_.RemoveObserver(observer); 20 audio_observers_.RemoveObserver(observer);
21 } 21 }
22 22
23 void SystemTrayNotifier::AddIMEObserver(IMEObserver* observer) {
24 ime_observers_.AddObserver(observer);
25 }
26
27 void SystemTrayNotifier::RemoveIMEObserver(IMEObserver* observer) {
28 ime_observers_.RemoveObserver(observer);
29 }
30
31 void SystemTrayNotifier::AddLocaleObserver(LocaleObserver* observer) { 23 void SystemTrayNotifier::AddLocaleObserver(LocaleObserver* observer) {
32 locale_observers_.AddObserver(observer); 24 locale_observers_.AddObserver(observer);
33 } 25 }
34 26
35 void SystemTrayNotifier::RemoveLocaleObserver(LocaleObserver* observer) { 27 void SystemTrayNotifier::RemoveLocaleObserver(LocaleObserver* observer) {
36 locale_observers_.RemoveObserver(observer); 28 locale_observers_.RemoveObserver(observer);
37 } 29 }
38 30
39 void SystemTrayNotifier::AddTracingObserver(TracingObserver* observer) { 31 void SystemTrayNotifier::AddTracingObserver(TracingObserver* observer) {
40 tracing_observers_.AddObserver(observer); 32 tracing_observers_.AddObserver(observer);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 void SystemTrayNotifier::AddLastWindowClosedObserver( 135 void SystemTrayNotifier::AddLastWindowClosedObserver(
144 LastWindowClosedObserver* observer) { 136 LastWindowClosedObserver* observer) {
145 last_window_closed_observers_.AddObserver(observer); 137 last_window_closed_observers_.AddObserver(observer);
146 } 138 }
147 139
148 void SystemTrayNotifier::RemoveLastWindowClosedObserver( 140 void SystemTrayNotifier::RemoveLastWindowClosedObserver(
149 LastWindowClosedObserver* observer) { 141 LastWindowClosedObserver* observer) {
150 last_window_closed_observers_.RemoveObserver(observer); 142 last_window_closed_observers_.RemoveObserver(observer);
151 } 143 }
152 144
153 void SystemTrayNotifier::AddVirtualKeyboardObserver( 145 #endif // defined(OS_CHROMEOS)
154 VirtualKeyboardObserver* observer) {
155 virtual_keyboard_observers_.AddObserver(observer);
156 }
157
158 void SystemTrayNotifier::RemoveVirtualKeyboardObserver(
159 VirtualKeyboardObserver* observer) {
160 virtual_keyboard_observers_.RemoveObserver(observer);
161 }
162 #endif
163 146
164 void SystemTrayNotifier::NotifyAudioOutputVolumeChanged(uint64_t node_id, 147 void SystemTrayNotifier::NotifyAudioOutputVolumeChanged(uint64_t node_id,
165 double volume) { 148 double volume) {
166 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, 149 FOR_EACH_OBSERVER(AudioObserver, audio_observers_,
167 OnOutputNodeVolumeChanged(node_id, volume)); 150 OnOutputNodeVolumeChanged(node_id, volume));
168 } 151 }
169 152
170 void SystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on, 153 void SystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on,
171 bool system_adjust) { 154 bool system_adjust) {
172 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, 155 FOR_EACH_OBSERVER(AudioObserver, audio_observers_,
(...skipping 21 matching lines...) Expand all
194 OnActiveInputNodeChanged()); 177 OnActiveInputNodeChanged());
195 } 178 }
196 179
197 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) { 180 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) {
198 FOR_EACH_OBSERVER( 181 FOR_EACH_OBSERVER(
199 TracingObserver, 182 TracingObserver,
200 tracing_observers_, 183 tracing_observers_,
201 OnTracingModeChanged(value)); 184 OnTracingModeChanged(value));
202 } 185 }
203 186
204 void SystemTrayNotifier::NotifyRefreshIME() {
205 FOR_EACH_OBSERVER(IMEObserver,
206 ime_observers_,
207 OnIMERefresh());
208 }
209
210 void SystemTrayNotifier::NotifyRefreshIMEMenu(bool is_active) {
211 FOR_EACH_OBSERVER(IMEObserver,
212 ime_observers_,
213 OnIMEMenuActivationChanged(is_active));
214 }
215
216 void SystemTrayNotifier::NotifyLocaleChanged( 187 void SystemTrayNotifier::NotifyLocaleChanged(
217 LocaleObserver::Delegate* delegate, 188 LocaleObserver::Delegate* delegate,
218 const std::string& cur_locale, 189 const std::string& cur_locale,
219 const std::string& from_locale, 190 const std::string& from_locale,
220 const std::string& to_locale) { 191 const std::string& to_locale) {
221 FOR_EACH_OBSERVER( 192 FOR_EACH_OBSERVER(
222 LocaleObserver, 193 LocaleObserver,
223 locale_observers_, 194 locale_observers_,
224 OnLocaleChanged(delegate, cur_locale, from_locale, to_locale)); 195 OnLocaleChanged(delegate, cur_locale, from_locale, to_locale));
225 } 196 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 FOR_EACH_OBSERVER(ScreenShareObserver, screen_share_observers_, 290 FOR_EACH_OBSERVER(ScreenShareObserver, screen_share_observers_,
320 OnScreenShareStop()); 291 OnScreenShareStop());
321 } 292 }
322 293
323 void SystemTrayNotifier::NotifyLastWindowClosed() { 294 void SystemTrayNotifier::NotifyLastWindowClosed() {
324 FOR_EACH_OBSERVER(LastWindowClosedObserver, 295 FOR_EACH_OBSERVER(LastWindowClosedObserver,
325 last_window_closed_observers_, 296 last_window_closed_observers_,
326 OnLastWindowClosed()); 297 OnLastWindowClosed());
327 } 298 }
328 299
329 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged(
330 bool suppressed) {
331 FOR_EACH_OBSERVER(VirtualKeyboardObserver,
332 virtual_keyboard_observers_,
333 OnKeyboardSuppressionChanged(suppressed));
334 }
335
336 #endif // OS_CHROMEOS 300 #endif // OS_CHROMEOS
337 301
338 } // namespace ash 302 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_notifier.h ('k') | ash/virtual_keyboard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698