| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 219 |
| 222 // Adds an observer whose |OnShutdownPolicyChanged| function is called when | 220 // Adds an observer whose |OnShutdownPolicyChanged| function is called when |
| 223 // the |DeviceRebootOnShutdown| policy changes. If this policy is set to | 221 // the |DeviceRebootOnShutdown| policy changes. If this policy is set to |
| 224 // true, a device cannot be shut down anymore but only rebooted. | 222 // true, a device cannot be shut down anymore but only rebooted. |
| 225 virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer); | 223 virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer); |
| 226 | 224 |
| 227 virtual void RemoveShutdownPolicyObserver(ShutdownPolicyObserver* observer); | 225 virtual void RemoveShutdownPolicyObserver(ShutdownPolicyObserver* observer); |
| 228 | 226 |
| 229 // Determines whether the device is automatically rebooted when shut down as | 227 // Determines whether the device is automatically rebooted when shut down as |
| 230 // specified by the device policy |DeviceRebootOnShutdown|. This function | 228 // specified by the device policy |DeviceRebootOnShutdown|. This function |
| 231 // asynchronously calls |callback| once a trusted policy becomes available. | 229 // notifies the shutdown policy observers added above once a trusted policy |
| 232 virtual void ShouldRebootOnShutdown(const RebootOnShutdownCallback& callback); | 230 // becomes available. |
| 231 virtual void CheckIfRebootOnShutdown(); |
| 233 | 232 |
| 234 // Returns VPNDelegate. May return nullptr. | 233 // Returns VPNDelegate. May return nullptr. |
| 235 virtual VPNDelegate* GetVPNDelegate() const; | 234 virtual VPNDelegate* GetVPNDelegate() const; |
| 236 | 235 |
| 237 // Creates a system tray item for display rotation lock. | 236 // Creates a system tray item for display rotation lock. |
| 238 // TODO(jamescook): Remove this when mus has support for display management | 237 // TODO(jamescook): Remove this when mus has support for display management |
| 239 // and we have a DisplayManager equivalent. See http://crbug.com/548429 | 238 // and we have a DisplayManager equivalent. See http://crbug.com/548429 |
| 240 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( | 239 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( |
| 241 SystemTray* tray); | 240 SystemTray* tray); |
| 242 }; | 241 }; |
| 243 | 242 |
| 244 } // namespace ash | 243 } // namespace ash |
| 245 | 244 |
| 246 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 245 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| OLD | NEW |