OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ |
6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "ash/common/accessibility_types.h" | 13 #include "ash/common/accessibility_types.h" |
14 #include "ash/common/session/session_state_observer.h" | 14 #include "ash/common/session/session_state_observer.h" |
15 #include "ash/common/system/chromeos/supervised/custodian_info_tray_observer.h" | 15 #include "ash/common/system/chromeos/supervised/custodian_info_tray_observer.h" |
16 #include "ash/common/system/tray/ime_info.h" | 16 #include "ash/common/system/tray/ime_info.h" |
17 #include "ash/common/system/tray/system_tray.h" | 17 #include "ash/common/system/tray/system_tray.h" |
18 #include "ash/common/system/tray/system_tray_delegate.h" | 18 #include "ash/common/system/tray/system_tray_delegate.h" |
19 #include "base/callback_forward.h" | 19 #include "base/callback_forward.h" |
20 #include "base/callback_list.h" | 20 #include "base/callback_list.h" |
21 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
22 #include "base/macros.h" | 22 #include "base/macros.h" |
23 #include "base/memory/ref_counted.h" | 23 #include "base/memory/ref_counted.h" |
24 #include "base/memory/weak_ptr.h" | 24 #include "base/memory/weak_ptr.h" |
25 #include "base/observer_list.h" | 25 #include "base/observer_list.h" |
26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
27 #include "chrome/browser/chromeos/settings/shutdown_policy_handler.h" | 27 #include "chrome/browser/chromeos/settings/shutdown_policy_handler.h" |
28 #include "chrome/browser/chromeos/system/system_clock.h" | |
29 #include "chrome/browser/chromeos/system/system_clock_observer.h" | |
30 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
31 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" | 29 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" |
32 #include "chrome/browser/ui/browser_list_observer.h" | 30 #include "chrome/browser/ui/browser_list_observer.h" |
33 #include "chromeos/audio/cras_audio_handler.h" | 31 #include "chromeos/audio/cras_audio_handler.h" |
34 #include "chromeos/dbus/session_manager_client.h" | 32 #include "chromeos/dbus/session_manager_client.h" |
35 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 33 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
36 #include "components/prefs/pref_change_registrar.h" | 34 #include "components/prefs/pref_change_registrar.h" |
37 #include "components/signin/core/account_id/account_id.h" | 35 #include "components/signin/core/account_id/account_id.h" |
38 #include "components/user_manager/user_manager.h" | 36 #include "components/user_manager/user_manager.h" |
39 #include "content/public/browser/notification_observer.h" | 37 #include "content/public/browser/notification_observer.h" |
(...skipping 23 matching lines...) Expand all Loading... |
63 public input_method::InputMethodManager::Observer, | 61 public input_method::InputMethodManager::Observer, |
64 public chromeos::CrasAudioHandler::AudioObserver, | 62 public chromeos::CrasAudioHandler::AudioObserver, |
65 public device::BluetoothAdapter::Observer, | 63 public device::BluetoothAdapter::Observer, |
66 public policy::CloudPolicyStore::Observer, | 64 public policy::CloudPolicyStore::Observer, |
67 public ash::SessionStateObserver, | 65 public ash::SessionStateObserver, |
68 public chrome::BrowserListObserver, | 66 public chrome::BrowserListObserver, |
69 public extensions::AppWindowRegistry::Observer, | 67 public extensions::AppWindowRegistry::Observer, |
70 public user_manager::UserManager::UserSessionStateObserver, | 68 public user_manager::UserManager::UserSessionStateObserver, |
71 public SupervisedUserServiceObserver, | 69 public SupervisedUserServiceObserver, |
72 public ShutdownPolicyHandler::Delegate, | 70 public ShutdownPolicyHandler::Delegate, |
73 public system::SystemClockObserver, | |
74 public input_method::InputMethodManager::ImeMenuObserver { | 71 public input_method::InputMethodManager::ImeMenuObserver { |
75 public: | 72 public: |
76 SystemTrayDelegateChromeOS(); | 73 SystemTrayDelegateChromeOS(); |
77 | 74 |
78 ~SystemTrayDelegateChromeOS() override; | 75 ~SystemTrayDelegateChromeOS() override; |
79 | 76 |
80 void InitializeOnAdapterReady( | 77 void InitializeOnAdapterReady( |
81 scoped_refptr<device::BluetoothAdapter> adapter); | 78 scoped_refptr<device::BluetoothAdapter> adapter); |
82 | 79 |
83 // Overridden from ash::SystemTrayDelegate: | 80 // Overridden from ash::SystemTrayDelegate: |
84 void Initialize() override; | 81 void Initialize() override; |
85 bool GetTrayVisibilityOnStartup() override; | 82 bool GetTrayVisibilityOnStartup() override; |
86 ash::LoginStatus GetUserLoginStatus() const override; | 83 ash::LoginStatus GetUserLoginStatus() const override; |
87 std::string GetEnterpriseDomain() const override; | 84 std::string GetEnterpriseDomain() const override; |
88 base::string16 GetEnterpriseMessage() const override; | 85 base::string16 GetEnterpriseMessage() const override; |
89 std::string GetSupervisedUserManager() const override; | 86 std::string GetSupervisedUserManager() const override; |
90 base::string16 GetSupervisedUserManagerName() const override; | 87 base::string16 GetSupervisedUserManagerName() const override; |
91 base::string16 GetSupervisedUserMessage() const override; | 88 base::string16 GetSupervisedUserMessage() const override; |
92 bool IsUserSupervised() const override; | 89 bool IsUserSupervised() const override; |
93 bool IsUserChild() const override; | 90 bool IsUserChild() const override; |
94 void GetSystemUpdateInfo(ash::UpdateInfo* info) const override; | 91 void GetSystemUpdateInfo(ash::UpdateInfo* info) const override; |
95 base::HourClockType GetHourClockType() const override; | |
96 void ShowSettings() override; | 92 void ShowSettings() override; |
97 bool ShouldShowSettings() override; | 93 bool ShouldShowSettings() override; |
98 void ShowDateSettings() override; | |
99 void ShowSetTimeDialog() override; | 94 void ShowSetTimeDialog() override; |
100 void ShowNetworkSettingsForGuid(const std::string& guid) override; | 95 void ShowNetworkSettingsForGuid(const std::string& guid) override; |
101 void ShowDisplaySettings() override; | 96 void ShowDisplaySettings() override; |
102 void ShowPowerSettings() override; | 97 void ShowPowerSettings() override; |
103 void ShowChromeSlow() override; | 98 void ShowChromeSlow() override; |
104 bool ShouldShowDisplayNotification() override; | 99 bool ShouldShowDisplayNotification() override; |
105 void ShowIMESettings() override; | 100 void ShowIMESettings() override; |
106 void ShowHelp() override; | 101 void ShowHelp() override; |
107 void ShowAccessibilityHelp() override; | 102 void ShowAccessibilityHelp() override; |
108 void ShowAccessibilitySettings() override; | 103 void ShowAccessibilitySettings() override; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 ash::VPNDelegate* GetVPNDelegate() const override; | 149 ash::VPNDelegate* GetVPNDelegate() const override; |
155 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem( | 150 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem( |
156 ash::SystemTray* tray) override; | 151 ash::SystemTray* tray) override; |
157 | 152 |
158 // Overridden from user_manager::UserManager::UserSessionStateObserver: | 153 // Overridden from user_manager::UserManager::UserSessionStateObserver: |
159 void UserAddedToSession(const user_manager::User* active_user) override; | 154 void UserAddedToSession(const user_manager::User* active_user) override; |
160 void ActiveUserChanged(const user_manager::User* active_user) override; | 155 void ActiveUserChanged(const user_manager::User* active_user) override; |
161 | 156 |
162 void UserChangedChildStatus(user_manager::User* user) override; | 157 void UserChangedChildStatus(user_manager::User* user) override; |
163 | 158 |
164 // browser tests need to call ShouldUse24HourClock(). | |
165 bool GetShouldUse24HourClockForTesting() const; | |
166 | |
167 // chromeos::system::SystemClockObserver implementation. | |
168 void OnSystemClockChanged(system::SystemClock*) override; | |
169 | |
170 private: | 159 private: |
171 ash::SystemTray* GetPrimarySystemTray(); | 160 ash::SystemTray* GetPrimarySystemTray(); |
172 | 161 |
173 ash::SystemTrayNotifier* GetSystemTrayNotifier(); | 162 ash::SystemTrayNotifier* GetSystemTrayNotifier(); |
174 | 163 |
175 void SetProfile(Profile* profile); | 164 void SetProfile(Profile* profile); |
176 | 165 |
177 bool UnsetProfile(Profile* profile); | 166 bool UnsetProfile(Profile* profile); |
178 | 167 |
179 bool ShouldUse24HourClock() const; | |
180 | |
181 void UpdateShowLogoutButtonInTray(); | 168 void UpdateShowLogoutButtonInTray(); |
182 | 169 |
183 void UpdateLogoutDialogDuration(); | 170 void UpdateLogoutDialogDuration(); |
184 | 171 |
185 void UpdateSessionStartTime(); | 172 void UpdateSessionStartTime(); |
186 | 173 |
187 void UpdateSessionLengthLimit(); | 174 void UpdateSessionLengthLimit(); |
188 | 175 |
189 void StopObservingAppWindowRegistry(); | 176 void StopObservingAppWindowRegistry(); |
190 | 177 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 override; | 268 override; |
282 | 269 |
283 // helper methods used by GetSupervisedUserMessage. | 270 // helper methods used by GetSupervisedUserMessage. |
284 const base::string16 GetLegacySupervisedUserMessage() const; | 271 const base::string16 GetLegacySupervisedUserMessage() const; |
285 const base::string16 GetChildUserMessage() const; | 272 const base::string16 GetChildUserMessage() const; |
286 | 273 |
287 std::unique_ptr<content::NotificationRegistrar> registrar_; | 274 std::unique_ptr<content::NotificationRegistrar> registrar_; |
288 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_; | 275 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_; |
289 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_; | 276 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_; |
290 Profile* user_profile_; | 277 Profile* user_profile_; |
291 base::HourClockType clock_type_; | |
292 int search_key_mapped_to_; | 278 int search_key_mapped_to_; |
293 bool screen_locked_; | 279 bool screen_locked_; |
294 bool have_session_start_time_; | 280 bool have_session_start_time_; |
295 base::TimeTicks session_start_time_; | 281 base::TimeTicks session_start_time_; |
296 bool have_session_length_limit_; | 282 bool have_session_length_limit_; |
297 base::TimeDelta session_length_limit_; | 283 base::TimeDelta session_length_limit_; |
298 std::string enterprise_domain_; | 284 std::string enterprise_domain_; |
299 bool should_run_bluetooth_discovery_; | 285 bool should_run_bluetooth_discovery_; |
300 bool session_started_; | 286 bool session_started_; |
301 | 287 |
(...skipping 14 matching lines...) Expand all Loading... |
316 | 302 |
317 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; | 303 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; |
318 | 304 |
319 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); | 305 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); |
320 }; | 306 }; |
321 | 307 |
322 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); | 308 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); |
323 | 309 |
324 } // namespace chromeos | 310 } // namespace chromeos |
325 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ | 311 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ |
OLD | NEW |