Windows should animate when they are about to get docked at screen edges.
[chromium-blink-merge.git] / ash / system / tray / system_tray_notifier.h
blob2ae739fe9e3b3fa715d7ad58e3cb5f571dd2ccb8
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.
5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
8 #include <string>
9 #include <vector>
11 #include "ash/ash_export.h"
12 #include "ash/system/bluetooth/bluetooth_observer.h"
13 #include "ash/system/brightness/brightness_observer.h"
14 #include "ash/system/chromeos/enterprise/enterprise_domain_observer.h"
15 #include "ash/system/chromeos/network/network_observer.h"
16 #include "ash/system/chromeos/tray_tracing.h"
17 #include "ash/system/date/clock_observer.h"
18 #include "ash/system/drive/drive_observer.h"
19 #include "ash/system/ime/ime_observer.h"
20 #include "ash/system/locale/locale_observer.h"
21 #include "ash/system/logout_button/logout_button_observer.h"
22 #include "ash/system/session_length_limit/session_length_limit_observer.h"
23 #include "ash/system/tray_accessibility.h"
24 #include "ash/system/tray_caps_lock.h"
25 #include "ash/system/user/update_observer.h"
26 #include "ash/system/user/user_observer.h"
27 #include "base/observer_list.h"
29 #if defined(OS_CHROMEOS)
30 #include "ash/system/chromeos/network/network_observer.h"
31 #include "ash/system/chromeos/screen_security/screen_capture_observer.h"
32 #include "ash/system/chromeos/screen_security/screen_share_observer.h"
33 #endif
35 namespace ash {
37 #if defined(OS_CHROMEOS)
38 class NetworkStateNotifier;
39 #endif
41 class ASH_EXPORT SystemTrayNotifier {
42 public:
43 SystemTrayNotifier();
44 ~SystemTrayNotifier();
46 void AddAccessibilityObserver(AccessibilityObserver* observer);
47 void RemoveAccessibilityObserver(AccessibilityObserver* observer);
49 void AddBluetoothObserver(BluetoothObserver* observer);
50 void RemoveBluetoothObserver(BluetoothObserver* observer);
52 void AddBrightnessObserver(BrightnessObserver* observer);
53 void RemoveBrightnessObserver(BrightnessObserver* observer);
55 void AddCapsLockObserver(CapsLockObserver* observer);
56 void RemoveCapsLockObserver(CapsLockObserver* observer);
58 void AddClockObserver(ClockObserver* observer);
59 void RemoveClockObserver(ClockObserver* observer);
61 void AddDriveObserver(DriveObserver* observer);
62 void RemoveDriveObserver(DriveObserver* observer);
64 void AddIMEObserver(IMEObserver* observer);
65 void RemoveIMEObserver(IMEObserver* observer);
67 void AddLocaleObserver(LocaleObserver* observer);
68 void RemoveLocaleObserver(LocaleObserver* observer);
70 void AddLogoutButtonObserver(LogoutButtonObserver* observer);
71 void RemoveLogoutButtonObserver(LogoutButtonObserver* observer);
73 void AddSessionLengthLimitObserver(SessionLengthLimitObserver* observer);
74 void RemoveSessionLengthLimitObserver(SessionLengthLimitObserver* observer);
76 void AddTracingObserver(TracingObserver* observer);
77 void RemoveTracingObserver(TracingObserver* observer);
79 void AddUpdateObserver(UpdateObserver* observer);
80 void RemoveUpdateObserver(UpdateObserver* observer);
82 void AddUserObserver(UserObserver* observer);
83 void RemoveUserObserver(UserObserver* observer);
85 #if defined(OS_CHROMEOS)
86 void AddNetworkObserver(NetworkObserver* observer);
87 void RemoveNetworkObserver(NetworkObserver* observer);
89 void AddEnterpriseDomainObserver(EnterpriseDomainObserver* observer);
90 void RemoveEnterpriseDomainObserver(EnterpriseDomainObserver* observer);
92 void AddScreenCaptureObserver(ScreenCaptureObserver* observer);
93 void RemoveScreenCaptureObserver(ScreenCaptureObserver* observer);
95 void AddScreenShareObserver(ScreenShareObserver* observer);
96 void RemoveScreenShareObserver(ScreenShareObserver* observer);
97 #endif
99 void NotifyAccessibilityModeChanged(
100 AccessibilityNotificationVisibility notify);
101 void NotifyTracingModeChanged(bool value);
102 void NotifyRefreshBluetooth();
103 void NotifyBluetoothDiscoveringChanged();
104 void NotifyBrightnessChanged(double level, bool user_initialted);
105 void NotifyCapsLockChanged(bool enabled, bool search_mapped_to_caps_lock);
106 void NotifyRefreshClock();
107 void NotifyDateFormatChanged();
108 void NotifySystemClockTimeUpdated();
109 void NotifyDriveJobUpdated(const DriveOperationStatus& status);
110 void NotifyRefreshIME(bool show_message);
111 void NotifyShowLoginButtonChanged(bool show_login_button);
112 void NotifyLocaleChanged(LocaleObserver::Delegate* delegate,
113 const std::string& cur_locale,
114 const std::string& from_locale,
115 const std::string& to_locale);
116 void NotifySessionStartTimeChanged();
117 void NotifySessionLengthLimitChanged();
118 void NotifyUpdateRecommended(UpdateObserver::UpdateSeverity severity);
119 void NotifyUserUpdate();
120 #if defined(OS_CHROMEOS)
121 void NotifySetNetworkMessage(NetworkTrayDelegate* delegate,
122 NetworkObserver::MessageType message_type,
123 NetworkObserver::NetworkType network_type,
124 const base::string16& title,
125 const base::string16& message,
126 const std::vector<base::string16>& links);
127 void NotifyClearNetworkMessage(NetworkObserver::MessageType message_type);
128 void NotifyRequestToggleWifi();
129 void NotifyEnterpriseDomainChanged();
130 void NotifyScreenCaptureStart(const base::Closure& stop_callback,
131 const base::string16& sharing_app_name);
132 void NotifyScreenCaptureStop();
133 void NotifyScreenShareStart(const base::Closure& stop_callback,
134 const base::string16& helper_name);
135 void NotifyScreenShareStop();
137 NetworkStateNotifier* network_state_notifier() {
138 return network_state_notifier_.get();
140 #endif
142 private:
143 ObserverList<AccessibilityObserver> accessibility_observers_;
144 ObserverList<BluetoothObserver> bluetooth_observers_;
145 ObserverList<BrightnessObserver> brightness_observers_;
146 ObserverList<CapsLockObserver> caps_lock_observers_;
147 ObserverList<ClockObserver> clock_observers_;
148 ObserverList<DriveObserver> drive_observers_;
149 ObserverList<IMEObserver> ime_observers_;
150 ObserverList<LocaleObserver> locale_observers_;
151 ObserverList<LogoutButtonObserver> logout_button_observers_;
152 ObserverList<SessionLengthLimitObserver> session_length_limit_observers_;
153 ObserverList<TracingObserver> tracing_observers_;
154 ObserverList<UpdateObserver> update_observers_;
155 ObserverList<UserObserver> user_observers_;
156 #if defined(OS_CHROMEOS)
157 ObserverList<NetworkObserver> network_observers_;
158 ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_;
159 ObserverList<ScreenCaptureObserver> screen_capture_observers_;
160 ObserverList<ScreenShareObserver> screen_share_observers_;
161 scoped_ptr<NetworkStateNotifier> network_state_notifier_;
162 #endif
164 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier);
167 } // namespace ash
169 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_