Chromium Code Reviews| 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" | 28 #include "chrome/browser/chromeos/system/system_clock.h" |
|
msw
2016/09/30 23:26:49
nit: remove
James Cook
2016/10/03 18:07:56
Done.
| |
| 29 #include "chrome/browser/chromeos/system/system_clock_observer.h" | 29 #include "chrome/browser/chromeos/system/system_clock_observer.h" |
|
msw
2016/09/30 23:26:49
nit: remove
James Cook
2016/10/03 18:07:56
Done.
| |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" | 31 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" |
| 32 #include "chrome/browser/ui/browser_list_observer.h" | 32 #include "chrome/browser/ui/browser_list_observer.h" |
| 33 #include "chromeos/audio/cras_audio_handler.h" | 33 #include "chromeos/audio/cras_audio_handler.h" |
| 34 #include "chromeos/dbus/session_manager_client.h" | 34 #include "chromeos/dbus/session_manager_client.h" |
| 35 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 35 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 36 #include "components/prefs/pref_change_registrar.h" | 36 #include "components/prefs/pref_change_registrar.h" |
| 37 #include "components/signin/core/account_id/account_id.h" | 37 #include "components/signin/core/account_id/account_id.h" |
| 38 #include "components/user_manager/user_manager.h" | 38 #include "components/user_manager/user_manager.h" |
| 39 #include "content/public/browser/notification_observer.h" | 39 #include "content/public/browser/notification_observer.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 63 public input_method::InputMethodManager::Observer, | 63 public input_method::InputMethodManager::Observer, |
| 64 public chromeos::CrasAudioHandler::AudioObserver, | 64 public chromeos::CrasAudioHandler::AudioObserver, |
| 65 public device::BluetoothAdapter::Observer, | 65 public device::BluetoothAdapter::Observer, |
| 66 public policy::CloudPolicyStore::Observer, | 66 public policy::CloudPolicyStore::Observer, |
| 67 public ash::SessionStateObserver, | 67 public ash::SessionStateObserver, |
| 68 public chrome::BrowserListObserver, | 68 public chrome::BrowserListObserver, |
| 69 public extensions::AppWindowRegistry::Observer, | 69 public extensions::AppWindowRegistry::Observer, |
| 70 public user_manager::UserManager::UserSessionStateObserver, | 70 public user_manager::UserManager::UserSessionStateObserver, |
| 71 public SupervisedUserServiceObserver, | 71 public SupervisedUserServiceObserver, |
| 72 public ShutdownPolicyHandler::Delegate, | 72 public ShutdownPolicyHandler::Delegate, |
| 73 public system::SystemClockObserver, | |
| 74 public input_method::InputMethodManager::ImeMenuObserver { | 73 public input_method::InputMethodManager::ImeMenuObserver { |
| 75 public: | 74 public: |
| 76 SystemTrayDelegateChromeOS(); | 75 SystemTrayDelegateChromeOS(); |
| 77 | 76 |
| 78 ~SystemTrayDelegateChromeOS() override; | 77 ~SystemTrayDelegateChromeOS() override; |
| 79 | 78 |
| 80 void InitializeOnAdapterReady( | 79 void InitializeOnAdapterReady( |
| 81 scoped_refptr<device::BluetoothAdapter> adapter); | 80 scoped_refptr<device::BluetoothAdapter> adapter); |
| 82 | 81 |
| 83 // Overridden from ash::SystemTrayDelegate: | 82 // Overridden from ash::SystemTrayDelegate: |
| 84 void Initialize() override; | 83 void Initialize() override; |
| 85 bool GetTrayVisibilityOnStartup() override; | 84 bool GetTrayVisibilityOnStartup() override; |
| 86 ash::LoginStatus GetUserLoginStatus() const override; | 85 ash::LoginStatus GetUserLoginStatus() const override; |
| 87 std::string GetEnterpriseDomain() const override; | 86 std::string GetEnterpriseDomain() const override; |
| 88 base::string16 GetEnterpriseMessage() const override; | 87 base::string16 GetEnterpriseMessage() const override; |
| 89 std::string GetSupervisedUserManager() const override; | 88 std::string GetSupervisedUserManager() const override; |
| 90 base::string16 GetSupervisedUserManagerName() const override; | 89 base::string16 GetSupervisedUserManagerName() const override; |
| 91 base::string16 GetSupervisedUserMessage() const override; | 90 base::string16 GetSupervisedUserMessage() const override; |
| 92 bool IsUserSupervised() const override; | 91 bool IsUserSupervised() const override; |
| 93 bool IsUserChild() const override; | 92 bool IsUserChild() const override; |
| 94 void GetSystemUpdateInfo(ash::UpdateInfo* info) const override; | 93 void GetSystemUpdateInfo(ash::UpdateInfo* info) const override; |
| 95 base::HourClockType GetHourClockType() const override; | |
| 96 void ShowSettings() override; | 94 void ShowSettings() override; |
| 97 bool ShouldShowSettings() override; | 95 bool ShouldShowSettings() override; |
| 98 void ShowDateSettings() override; | |
| 99 void ShowSetTimeDialog() override; | 96 void ShowSetTimeDialog() override; |
| 100 void ShowNetworkSettingsForGuid(const std::string& guid) override; | 97 void ShowNetworkSettingsForGuid(const std::string& guid) override; |
| 101 void ShowDisplaySettings() override; | 98 void ShowDisplaySettings() override; |
| 102 void ShowPowerSettings() override; | 99 void ShowPowerSettings() override; |
| 103 void ShowChromeSlow() override; | 100 void ShowChromeSlow() override; |
| 104 bool ShouldShowDisplayNotification() override; | 101 bool ShouldShowDisplayNotification() override; |
| 105 void ShowIMESettings() override; | 102 void ShowIMESettings() override; |
| 106 void ShowHelp() override; | 103 void ShowHelp() override; |
| 107 void ShowAccessibilityHelp() override; | 104 void ShowAccessibilityHelp() override; |
| 108 void ShowAccessibilitySettings() override; | 105 void ShowAccessibilitySettings() override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem( | 152 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem( |
| 156 ash::SystemTray* tray) override; | 153 ash::SystemTray* tray) override; |
| 157 | 154 |
| 158 // Overridden from user_manager::UserManager::UserSessionStateObserver: | 155 // Overridden from user_manager::UserManager::UserSessionStateObserver: |
| 159 void UserAddedToSession(const user_manager::User* active_user) override; | 156 void UserAddedToSession(const user_manager::User* active_user) override; |
| 160 void ActiveUserChanged(const user_manager::User* active_user) override; | 157 void ActiveUserChanged(const user_manager::User* active_user) override; |
| 161 | 158 |
| 162 void UserChangedChildStatus(user_manager::User* user) override; | 159 void UserChangedChildStatus(user_manager::User* user) override; |
| 163 | 160 |
| 164 // browser tests need to call ShouldUse24HourClock(). | 161 // browser tests need to call ShouldUse24HourClock(). |
| 165 bool GetShouldUse24HourClockForTesting() const; | 162 bool GetShouldUse24HourClockForTesting() const; |
|
msw
2016/09/30 23:26:49
nit: can we remove this? (make tests call a new Sy
James Cook
2016/10/03 18:07:56
I inlined the implementation in the one test that
| |
| 166 | 163 |
| 167 // chromeos::system::SystemClockObserver implementation. | |
| 168 void OnSystemClockChanged(system::SystemClock*) override; | |
| 169 | |
| 170 private: | 164 private: |
| 171 ash::SystemTray* GetPrimarySystemTray(); | 165 ash::SystemTray* GetPrimarySystemTray(); |
| 172 | 166 |
| 173 ash::SystemTrayNotifier* GetSystemTrayNotifier(); | 167 ash::SystemTrayNotifier* GetSystemTrayNotifier(); |
| 174 | 168 |
| 175 void SetProfile(Profile* profile); | 169 void SetProfile(Profile* profile); |
| 176 | 170 |
| 177 bool UnsetProfile(Profile* profile); | 171 bool UnsetProfile(Profile* profile); |
| 178 | 172 |
| 179 bool ShouldUse24HourClock() const; | 173 bool ShouldUse24HourClock() const; |
|
msw
2016/09/30 23:26:49
nit: can we remove this? (is this even defined any
James Cook
2016/10/03 18:07:56
Done.
| |
| 180 | 174 |
| 181 void UpdateShowLogoutButtonInTray(); | 175 void UpdateShowLogoutButtonInTray(); |
| 182 | 176 |
| 183 void UpdateLogoutDialogDuration(); | 177 void UpdateLogoutDialogDuration(); |
| 184 | 178 |
| 185 void UpdateSessionStartTime(); | 179 void UpdateSessionStartTime(); |
| 186 | 180 |
| 187 void UpdateSessionLengthLimit(); | 181 void UpdateSessionLengthLimit(); |
| 188 | 182 |
| 189 void StopObservingAppWindowRegistry(); | 183 void StopObservingAppWindowRegistry(); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 override; | 275 override; |
| 282 | 276 |
| 283 // helper methods used by GetSupervisedUserMessage. | 277 // helper methods used by GetSupervisedUserMessage. |
| 284 const base::string16 GetLegacySupervisedUserMessage() const; | 278 const base::string16 GetLegacySupervisedUserMessage() const; |
| 285 const base::string16 GetChildUserMessage() const; | 279 const base::string16 GetChildUserMessage() const; |
| 286 | 280 |
| 287 std::unique_ptr<content::NotificationRegistrar> registrar_; | 281 std::unique_ptr<content::NotificationRegistrar> registrar_; |
| 288 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_; | 282 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_; |
| 289 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_; | 283 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_; |
| 290 Profile* user_profile_; | 284 Profile* user_profile_; |
| 291 base::HourClockType clock_type_; | 285 base::HourClockType clock_type_; |
|
msw
2016/09/30 23:26:49
nit: remove
James Cook
2016/10/03 18:07:56
Done.
| |
| 292 int search_key_mapped_to_; | 286 int search_key_mapped_to_; |
| 293 bool screen_locked_; | 287 bool screen_locked_; |
| 294 bool have_session_start_time_; | 288 bool have_session_start_time_; |
| 295 base::TimeTicks session_start_time_; | 289 base::TimeTicks session_start_time_; |
| 296 bool have_session_length_limit_; | 290 bool have_session_length_limit_; |
| 297 base::TimeDelta session_length_limit_; | 291 base::TimeDelta session_length_limit_; |
| 298 std::string enterprise_domain_; | 292 std::string enterprise_domain_; |
| 299 bool should_run_bluetooth_discovery_; | 293 bool should_run_bluetooth_discovery_; |
| 300 bool session_started_; | 294 bool session_started_; |
| 301 | 295 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 316 | 310 |
| 317 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; | 311 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; |
| 318 | 312 |
| 319 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); | 313 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); |
| 320 }; | 314 }; |
| 321 | 315 |
| 322 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); | 316 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); |
| 323 | 317 |
| 324 } // namespace chromeos | 318 } // namespace chromeos |
| 325 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ | 319 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ |
| OLD | NEW |