| 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; |
| 38 gfx::ImageSkia image; | 39 gfx::ImageSkia image; |
| 39 base::string16 name; | 40 base::string16 name; |
| 40 base::string16 description; | 41 base::string16 description; |
| 41 std::string service_path; | 42 std::string service_path; |
| 42 bool is_cellular; | 43 bool is_cellular; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 struct ASH_EXPORT BluetoothDeviceInfo { | 46 struct ASH_EXPORT BluetoothDeviceInfo { |
| 46 BluetoothDeviceInfo(); | 47 BluetoothDeviceInfo(); |
| 47 ~BluetoothDeviceInfo(); | 48 ~BluetoothDeviceInfo(); |
| 48 | 49 |
| 49 std::string address; | 50 std::string address; |
| 50 base::string16 display_name; | 51 base::string16 display_name; |
| 51 bool connected; | 52 bool connected; |
| 52 bool connecting; | 53 bool connecting; |
| 53 bool paired; | 54 bool paired; |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 typedef std::vector<BluetoothDeviceInfo> BluetoothDeviceList; | 57 using BluetoothDeviceList = std::vector<BluetoothDeviceInfo>; |
| 57 | 58 |
| 58 struct ASH_EXPORT IMEPropertyInfo { | 59 struct ASH_EXPORT IMEPropertyInfo { |
| 59 IMEPropertyInfo(); | 60 IMEPropertyInfo(); |
| 60 ~IMEPropertyInfo(); | 61 ~IMEPropertyInfo(); |
| 61 | 62 |
| 62 bool selected; | 63 bool selected; |
| 63 std::string key; | 64 std::string key; |
| 64 base::string16 name; | 65 base::string16 name; |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 typedef std::vector<IMEPropertyInfo> IMEPropertyInfoList; | 68 using IMEPropertyInfoList = std::vector<IMEPropertyInfo>; |
| 68 | 69 |
| 69 struct ASH_EXPORT IMEInfo { | 70 struct ASH_EXPORT IMEInfo { |
| 70 IMEInfo(); | 71 IMEInfo(); |
| 71 ~IMEInfo(); | 72 ~IMEInfo(); |
| 72 | 73 |
| 73 bool selected; | 74 bool selected; |
| 74 bool third_party; | 75 bool third_party; |
| 75 std::string id; | 76 std::string id; |
| 76 base::string16 name; | 77 base::string16 name; |
| 77 base::string16 medium_name; | 78 base::string16 medium_name; |
| 78 base::string16 short_name; | 79 base::string16 short_name; |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 struct ASH_EXPORT UpdateInfo { | 82 struct ASH_EXPORT UpdateInfo { |
| 82 enum UpdateSeverity { | 83 enum UpdateSeverity { |
| 83 UPDATE_NORMAL, | 84 UPDATE_NORMAL, |
| 84 UPDATE_LOW_GREEN, | 85 UPDATE_LOW_GREEN, |
| 85 UPDATE_HIGH_ORANGE, | 86 UPDATE_HIGH_ORANGE, |
| 86 UPDATE_SEVERE_RED, | 87 UPDATE_SEVERE_RED, |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 UpdateInfo(); | 90 UpdateInfo(); |
| 90 ~UpdateInfo(); | 91 ~UpdateInfo(); |
| 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 using IMEInfoList = std::vector<IMEInfo>; |
| 98 | 99 |
| 99 class VolumeControlDelegate; | 100 class VolumeControlDelegate; |
| 100 | 101 |
| 102 using RebootOnShutdownCallback = base::Callback<void(bool)>; |
| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 201 |
| 199 // Shows information about enterprise enrolled devices. | 202 // Shows information about enterprise enrolled devices. |
| 200 virtual void ShowEnterpriseInfo() = 0; | 203 virtual void ShowEnterpriseInfo() = 0; |
| 201 | 204 |
| 202 // Shows information about supervised users. | 205 // Shows information about supervised users. |
| 203 virtual void ShowSupervisedUserInfo() = 0; | 206 virtual void ShowSupervisedUserInfo() = 0; |
| 204 | 207 |
| 205 // Shows login UI to add other users to this session. | 208 // Shows login UI to add other users to this session. |
| 206 virtual void ShowUserLogin() = 0; | 209 virtual void ShowUserLogin() = 0; |
| 207 | 210 |
| 208 // Attempts to shut down the system. | |
| 209 virtual void ShutDown() = 0; | |
| 210 | |
| 211 // Attempts to sign out the user. | 211 // Attempts to sign out the user. |
| 212 virtual void SignOut() = 0; | 212 virtual void SignOut() = 0; |
| 213 | 213 |
| 214 // Attempts to lock the screen. | 214 // Attempts to lock the screen. |
| 215 virtual void RequestLockScreen() = 0; | 215 virtual void RequestLockScreen() = 0; |
| 216 | 216 |
| 217 // Attempts to restart the system for update. | 217 // Attempts to restart the system for update. |
| 218 virtual void RequestRestartForUpdate() = 0; | 218 virtual void RequestRestartForUpdate() = 0; |
| 219 | 219 |
| 220 // Returns a list of available bluetooth devices. | 220 // Returns a list of available bluetooth devices. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // Returns accounts delegate for given user. | 296 // Returns accounts delegate for given user. |
| 297 virtual tray::UserAccountsDelegate* GetUserAccountsDelegate( | 297 virtual tray::UserAccountsDelegate* GetUserAccountsDelegate( |
| 298 const std::string& user_id) = 0; | 298 const std::string& user_id) = 0; |
| 299 | 299 |
| 300 // Adding observers that are notified when supervised info is being changed. | 300 // Adding observers that are notified when supervised info is being changed. |
| 301 virtual void AddCustodianInfoTrayObserver( | 301 virtual void AddCustodianInfoTrayObserver( |
| 302 CustodianInfoTrayObserver* observer) = 0; | 302 CustodianInfoTrayObserver* observer) = 0; |
| 303 | 303 |
| 304 virtual void RemoveCustodianInfoTrayObserver( | 304 virtual void RemoveCustodianInfoTrayObserver( |
| 305 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 virtual void RemoveShutdownPolicyObserver( |
| 313 ShutdownPolicyObserver* observer) = 0; |
| 314 |
| 315 // Determines whether the device is automatically rebooted when shut down as |
| 316 // specified by the device policy |DeviceRebootOnShutdown|. This function |
| 317 // asynchronously calls |callback| once a trusted policy becomes available. |
| 318 virtual void ShouldRebootOnShutdown( |
| 319 const RebootOnShutdownCallback& callback) = 0; |
| 306 }; | 320 }; |
| 307 | 321 |
| 308 } // namespace ash | 322 } // namespace ash |
| 309 | 323 |
| 310 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 324 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| OLD | NEW |