Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/system/user/login_status.h" | 12 #include "ash/system/user/login_status.h" |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/i18n/time_formatting.h" | 15 #include "base/i18n/time_formatting.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "ui/gfx/image/image_skia.h" | 18 #include "ui/gfx/image/image_skia.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class TimeDelta; | 21 class TimeDelta; |
| 22 class TimeTicks; | 22 class TimeTicks; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 | 26 |
| 27 class CustodianInfoTrayObserver; | 27 class CustodianInfoTrayObserver; |
| 28 class ShutdownPolicyObserver; | |
| 28 | 29 |
| 29 struct ASH_EXPORT NetworkIconInfo { | 30 struct ASH_EXPORT NetworkIconInfo { |
| 30 NetworkIconInfo(); | 31 NetworkIconInfo(); |
| 31 ~NetworkIconInfo(); | 32 ~NetworkIconInfo(); |
| 32 | 33 |
| 33 bool highlight() const { return connected || connecting; } | 34 bool highlight() const { return connected || connecting; } |
| 34 | 35 |
| 35 bool connecting; | 36 bool connecting; |
| 36 bool connected; | 37 bool connected; |
| 37 bool tray_icon_visible; | 38 bool tray_icon_visible; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 92 |
| 92 UpdateSeverity severity; | 93 UpdateSeverity severity; |
| 93 bool update_required; | 94 bool update_required; |
| 94 bool factory_reset_required; | 95 bool factory_reset_required; |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 typedef std::vector<IMEInfo> IMEInfoList; | 98 typedef std::vector<IMEInfo> IMEInfoList; |
| 98 | 99 |
| 99 class VolumeControlDelegate; | 100 class VolumeControlDelegate; |
| 100 | 101 |
| 102 using RebootOnShutdownCallback = base::Callback<void(bool)>; | |
|
stevenjb
2014/12/17 19:09:02
Update other typedefs in this header to 'using'
cschuet (SLOW)
2015/01/07 14:37:07
Done.
| |
| 103 | |
| 101 namespace tray { | 104 namespace tray { |
| 102 class UserAccountsDelegate; | 105 class UserAccountsDelegate; |
| 103 } // namespace tray | 106 } // namespace tray |
| 104 | 107 |
| 105 class ASH_EXPORT SystemTrayDelegate { | 108 class ASH_EXPORT SystemTrayDelegate { |
| 106 public: | 109 public: |
| 107 virtual ~SystemTrayDelegate() {} | 110 virtual ~SystemTrayDelegate() {} |
| 108 | 111 |
| 109 // Called after SystemTray has been instantiated. | 112 // Called after SystemTray has been instantiated. |
| 110 virtual void Initialize() = 0; | 113 virtual void Initialize() = 0; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 | 195 |
| 193 // Shows information about enterprise enrolled devices. | 196 // Shows information about enterprise enrolled devices. |
| 194 virtual void ShowEnterpriseInfo() = 0; | 197 virtual void ShowEnterpriseInfo() = 0; |
| 195 | 198 |
| 196 // Shows information about supervised users. | 199 // Shows information about supervised users. |
| 197 virtual void ShowSupervisedUserInfo() = 0; | 200 virtual void ShowSupervisedUserInfo() = 0; |
| 198 | 201 |
| 199 // Shows login UI to add other users to this session. | 202 // Shows login UI to add other users to this session. |
| 200 virtual void ShowUserLogin() = 0; | 203 virtual void ShowUserLogin() = 0; |
| 201 | 204 |
| 205 // Attempts to reboot the system. | |
|
stevenjb
2014/12/17 19:09:02
restart
cschuet (SLOW)
2015/01/07 14:37:07
This function has been removed in the new version
| |
| 206 virtual void Restart() = 0; | |
| 207 | |
| 202 // Attempts to shut down the system. | 208 // Attempts to shut down the system. |
| 203 virtual void ShutDown() = 0; | 209 virtual void ShutDown() = 0; |
| 204 | 210 |
| 205 // Attempts to sign out the user. | 211 // Attempts to sign out the user. |
| 206 virtual void SignOut() = 0; | 212 virtual void SignOut() = 0; |
| 207 | 213 |
| 208 // Attempts to lock the screen. | 214 // Attempts to lock the screen. |
| 209 virtual void RequestLockScreen() = 0; | 215 virtual void RequestLockScreen() = 0; |
| 210 | 216 |
| 211 // Attempts to restart the system for update. | 217 // Attempts to restart the system for update. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 // Returns accounts delegate for given user. | 296 // Returns accounts delegate for given user. |
| 291 virtual tray::UserAccountsDelegate* GetUserAccountsDelegate( | 297 virtual tray::UserAccountsDelegate* GetUserAccountsDelegate( |
| 292 const std::string& user_id) = 0; | 298 const std::string& user_id) = 0; |
| 293 | 299 |
| 294 // Adding observers that are notified when supervised info is being changed. | 300 // Adding observers that are notified when supervised info is being changed. |
| 295 virtual void AddCustodianInfoTrayObserver( | 301 virtual void AddCustodianInfoTrayObserver( |
| 296 CustodianInfoTrayObserver* observer) = 0; | 302 CustodianInfoTrayObserver* observer) = 0; |
| 297 | 303 |
| 298 virtual void RemoveCustodianInfoTrayObserver( | 304 virtual void RemoveCustodianInfoTrayObserver( |
| 299 CustodianInfoTrayObserver* observer) = 0; | 305 CustodianInfoTrayObserver* observer) = 0; |
| 306 | |
| 307 // Adds an observer whose |OnShutdownPolicyChanged| function is called when | |
| 308 // the |DeviceRebootOnShutdown| policy changes. If this policy is set to | |
| 309 // true, a device cannot be shut down anymore but only rebooted. | |
| 310 virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer) = 0; | |
| 311 | |
| 312 // Determines whether the device is automatically rebooted when shut down as | |
| 313 // specified by the device policy |DeviceRebootOnShutdown|. This function | |
| 314 // asynchronously calls |RebootOnShutdownCallback| once a trusted policy | |
|
stevenjb
2014/12/17 19:09:02
Use variable name |callback| instead of type.
cschuet (SLOW)
2015/01/07 14:37:07
Done.
| |
| 315 // becomes available. | |
| 316 virtual void ShouldRebootOnShutdown( | |
| 317 const RebootOnShutdownCallback& callback) = 0; | |
|
stevenjb
2014/12/17 19:09:02
This should be named something like 'RequestShould
cschuet (SLOW)
2015/01/07 14:37:07
ShouldRebootOnShutdown is supposed to sound like a
| |
| 318 | |
| 319 virtual void RemoveShutdownPolicyObserver( | |
|
stevenjb
2014/12/17 19:09:02
Remove should follow Add here and elsewhere.
cschuet (SLOW)
2015/01/07 14:37:07
Done.
| |
| 320 ShutdownPolicyObserver* observer) = 0; | |
| 300 }; | 321 }; |
| 301 | 322 |
| 302 } // namespace ash | 323 } // namespace ash |
| 303 | 324 |
| 304 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 325 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| OLD | NEW |