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

Side by Side Diff: ash/common/system/tray/wm_system_tray_notifier.h

Issue 2098023002: mash: Migrate remaining tray observers and notify functions. (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
OLDNEW
(Empty)
1 // Copyright 2016 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 #ifndef ASH_COMMON_SYSTEM_TRAY_WM_SYSTEM_TRAY_NOTIFIER_H_
6 #define ASH_COMMON_SYSTEM_TRAY_WM_SYSTEM_TRAY_NOTIFIER_H_
7
8 #include "ash/ash_export.h"
9 #include "ash/common/accessibility_types.h"
10 #include "ash/common/system/locale/locale_observer.h"
11 #include "base/macros.h"
12 #include "base/observer_list.h"
13
14 namespace ash {
15
16 class AccessibilityObserver;
17 class AudioObserver;
18 class ClockObserver;
19 class IMEObserver;
20 struct UpdateInfo;
21 class UpdateObserver;
22
23 #if defined(OS_CHROMEOS)
24 class TracingObserver;
25 class VirtualKeyboardObserver;
26 #endif
27
28 // Observer and notification manager for the ash system tray. This version
29 // contains the observers that have been ported to //ash/common. See also
30 // ash::SystemTrayNotifier.
31 // TODO(jamescook): After all the observers have been moved, rename this class
32 // to SystemTrayNotifier.
33 class ASH_EXPORT WmSystemTrayNotifier {
34 public:
35 WmSystemTrayNotifier();
36 ~WmSystemTrayNotifier();
37
38 // Accessibility.
39 void AddAccessibilityObserver(AccessibilityObserver* observer);
40 void RemoveAccessibilityObserver(AccessibilityObserver* observer);
41 void NotifyAccessibilityModeChanged(
42 AccessibilityNotificationVisibility notify);
43
44 // Audio.
45 void AddAudioObserver(AudioObserver* observer);
46 void RemoveAudioObserver(AudioObserver* observer);
47 void NotifyAudioOutputVolumeChanged(uint64_t node_id, double volume);
48 void NotifyAudioOutputMuteChanged(bool mute_on, bool system_adjust);
49 void NotifyAudioNodesChanged();
50 void NotifyAudioActiveOutputNodeChanged();
51 void NotifyAudioActiveInputNodeChanged();
52
53 // Date and time.
54 void AddClockObserver(ClockObserver* observer);
55 void RemoveClockObserver(ClockObserver* observer);
56 void NotifyRefreshClock();
57 void NotifyDateFormatChanged();
58 void NotifySystemClockTimeUpdated();
59 void NotifySystemClockCanSetTimeChanged(bool can_set_time);
60
61 // Input methods.
62 void AddIMEObserver(IMEObserver* observer);
63 void RemoveIMEObserver(IMEObserver* observer);
64 void NotifyRefreshIME();
65 void NotifyRefreshIMEMenu(bool is_active);
66
67 // Locale.
68 void AddLocaleObserver(LocaleObserver* observer);
69 void RemoveLocaleObserver(LocaleObserver* observer);
70 void NotifyLocaleChanged(LocaleObserver::Delegate* delegate,
71 const std::string& cur_locale,
72 const std::string& from_locale,
73 const std::string& to_locale);
74
75 // OS updates.
76 void AddUpdateObserver(UpdateObserver* observer);
77 void RemoveUpdateObserver(UpdateObserver* observer);
78 void NotifyUpdateRecommended(const UpdateInfo& info);
79
80 #if defined(OS_CHROMEOS)
81 // Tracing.
82 void AddTracingObserver(TracingObserver* observer);
83 void RemoveTracingObserver(TracingObserver* observer);
84 void NotifyTracingModeChanged(bool value);
85
86 // Virtual keyboard.
87 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
88 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
89 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed);
90 #endif
91
92 private:
93 base::ObserverList<AccessibilityObserver> accessibility_observers_;
94 base::ObserverList<AudioObserver> audio_observers_;
95 base::ObserverList<ClockObserver> clock_observers_;
96 base::ObserverList<IMEObserver> ime_observers_;
97 base::ObserverList<LocaleObserver> locale_observers_;
98 base::ObserverList<UpdateObserver> update_observers_;
99
100 #if defined(OS_CHROMEOS)
101 base::ObserverList<TracingObserver> tracing_observers_;
102 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_;
103 #endif
104
105 DISALLOW_COPY_AND_ASSIGN(WmSystemTrayNotifier);
106 };
107
108 } // namespace ash
109
110 #endif // ASH_COMMON_SYSTEM_TRAY_WM_SYSTEM_TRAY_NOTIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698