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_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 UpdateSeverity severity; | 70 UpdateSeverity severity; |
71 bool update_required; | 71 bool update_required; |
72 bool factory_reset_required; | 72 bool factory_reset_required; |
73 }; | 73 }; |
74 | 74 |
75 class CastConfigDelegate; | 75 class CastConfigDelegate; |
76 class NetworkingConfigDelegate; | 76 class NetworkingConfigDelegate; |
77 class VPNDelegate; | 77 class VPNDelegate; |
78 | 78 |
79 using RebootOnShutdownCallback = base::Callback<void(bool)>; | |
80 | |
81 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the | 79 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the |
82 // application (e.g. Chrome). These tasks should be limited to application | 80 // application (e.g. Chrome). These tasks should be limited to application |
83 // (browser) specific tasks. For non application specific tasks, where possible, | 81 // (browser) specific tasks. For non application specific tasks, where possible, |
84 // components/, chromeos/, device/, etc., code should be used directly. If more | 82 // components/, chromeos/, device/, etc., code should be used directly. If more |
85 // than one related method is being added, consider adding an additional | 83 // than one related method is being added, consider adding an additional |
86 // specific delegate (e.g. VPNDelegate). | 84 // specific delegate (e.g. VPNDelegate). |
87 // | 85 // |
88 // These methods should all have trivial default implementations for platforms | 86 // These methods should all have trivial default implementations for platforms |
89 // that do not implement the method (e.g. return false or nullptr). This | 87 // that do not implement the method (e.g. return false or nullptr). This |
90 // eliminates the need to propagate default implementations across the various | 88 // eliminates the need to propagate default implementations across the various |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 223 |
226 // Adds an observer whose |OnShutdownPolicyChanged| function is called when | 224 // Adds an observer whose |OnShutdownPolicyChanged| function is called when |
227 // the |DeviceRebootOnShutdown| policy changes. If this policy is set to | 225 // the |DeviceRebootOnShutdown| policy changes. If this policy is set to |
228 // true, a device cannot be shut down anymore but only rebooted. | 226 // true, a device cannot be shut down anymore but only rebooted. |
229 virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer); | 227 virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer); |
230 | 228 |
231 virtual void RemoveShutdownPolicyObserver(ShutdownPolicyObserver* observer); | 229 virtual void RemoveShutdownPolicyObserver(ShutdownPolicyObserver* observer); |
232 | 230 |
233 // Determines whether the device is automatically rebooted when shut down as | 231 // Determines whether the device is automatically rebooted when shut down as |
234 // specified by the device policy |DeviceRebootOnShutdown|. This function | 232 // specified by the device policy |DeviceRebootOnShutdown|. This function |
235 // asynchronously calls |callback| once a trusted policy becomes available. | 233 // notifies the shutdown policy observers added above once a trusted policy |
236 virtual void ShouldRebootOnShutdown(const RebootOnShutdownCallback& callback); | 234 // becomes available. |
| 235 virtual void CheckIfRebootOnShutdown(); |
237 | 236 |
238 // Returns VPNDelegate. May return nullptr. | 237 // Returns VPNDelegate. May return nullptr. |
239 virtual VPNDelegate* GetVPNDelegate() const; | 238 virtual VPNDelegate* GetVPNDelegate() const; |
240 | 239 |
241 // Creates a system tray item for display rotation lock. | 240 // Creates a system tray item for display rotation lock. |
242 // TODO(jamescook): Remove this when mus has support for display management | 241 // TODO(jamescook): Remove this when mus has support for display management |
243 // and we have a DisplayManager equivalent. See http://crbug.com/548429 | 242 // and we have a DisplayManager equivalent. See http://crbug.com/548429 |
244 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( | 243 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( |
245 SystemTray* tray); | 244 SystemTray* tray); |
246 }; | 245 }; |
247 | 246 |
248 } // namespace ash | 247 } // namespace ash |
249 | 248 |
250 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 249 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
OLD | NEW |