Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: ash/common/system/tray/system_tray_delegate.h

Issue 2497123002: chromeos: Move device shutdown handling out of chrome into ash (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/system/tiles/tray_tiles.cc ('k') | ash/common/system/tray/system_tray_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 25
26 namespace device { 26 namespace device {
27 enum class BluetoothDeviceType; 27 enum class BluetoothDeviceType;
28 } 28 }
29 29
30 namespace ash { 30 namespace ash {
31 struct IMEInfo; 31 struct IMEInfo;
32 struct IMEPropertyInfo; 32 struct IMEPropertyInfo;
33 33
34 class CustodianInfoTrayObserver; 34 class CustodianInfoTrayObserver;
35 class ShutdownPolicyObserver;
36 class SystemTray; 35 class SystemTray;
37 class SystemTrayItem; 36 class SystemTrayItem;
38 37
39 using IMEInfoList = std::vector<IMEInfo>; 38 using IMEInfoList = std::vector<IMEInfo>;
40 using IMEPropertyInfoList = std::vector<IMEPropertyInfo>; 39 using IMEPropertyInfoList = std::vector<IMEPropertyInfo>;
41 40
42 struct ASH_EXPORT BluetoothDeviceInfo { 41 struct ASH_EXPORT BluetoothDeviceInfo {
43 BluetoothDeviceInfo(); 42 BluetoothDeviceInfo();
44 BluetoothDeviceInfo(const BluetoothDeviceInfo& other); 43 BluetoothDeviceInfo(const BluetoothDeviceInfo& other);
45 ~BluetoothDeviceInfo(); 44 ~BluetoothDeviceInfo();
(...skipping 23 matching lines...) Expand all
69 68
70 UpdateSeverity severity; 69 UpdateSeverity severity;
71 bool update_required; 70 bool update_required;
72 bool factory_reset_required; 71 bool factory_reset_required;
73 }; 72 };
74 73
75 class CastConfigDelegate; 74 class CastConfigDelegate;
76 class NetworkingConfigDelegate; 75 class NetworkingConfigDelegate;
77 class VPNDelegate; 76 class VPNDelegate;
78 77
79 using RebootOnShutdownCallback = base::Callback<void(bool)>;
80
81 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the 78 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the
82 // application (e.g. Chrome). These tasks should be limited to application 79 // application (e.g. Chrome). These tasks should be limited to application
83 // (browser) specific tasks. For non application specific tasks, where possible, 80 // (browser) specific tasks. For non application specific tasks, where possible,
84 // components/, chromeos/, device/, etc., code should be used directly. If more 81 // components/, chromeos/, device/, etc., code should be used directly. If more
85 // than one related method is being added, consider adding an additional 82 // than one related method is being added, consider adding an additional
86 // specific delegate (e.g. VPNDelegate). 83 // specific delegate (e.g. VPNDelegate).
87 // 84 //
88 // These methods should all have trivial default implementations for platforms 85 // These methods should all have trivial default implementations for platforms
89 // that do not implement the method (e.g. return false or nullptr). This 86 // that do not implement the method (e.g. return false or nullptr). This
90 // eliminates the need to propagate default implementations across the various 87 // eliminates the need to propagate default implementations across the various
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Returns true when the Search key is configured to be treated as Caps Lock. 213 // Returns true when the Search key is configured to be treated as Caps Lock.
217 virtual bool IsSearchKeyMappedToCapsLock(); 214 virtual bool IsSearchKeyMappedToCapsLock();
218 215
219 // Adding observers that are notified when supervised info is being changed. 216 // Adding observers that are notified when supervised info is being changed.
220 virtual void AddCustodianInfoTrayObserver( 217 virtual void AddCustodianInfoTrayObserver(
221 CustodianInfoTrayObserver* observer); 218 CustodianInfoTrayObserver* observer);
222 219
223 virtual void RemoveCustodianInfoTrayObserver( 220 virtual void RemoveCustodianInfoTrayObserver(
224 CustodianInfoTrayObserver* observer); 221 CustodianInfoTrayObserver* observer);
225 222
226 // Adds an observer whose |OnShutdownPolicyChanged| function is called when
227 // the |DeviceRebootOnShutdown| policy changes. If this policy is set to
228 // true, a device cannot be shut down anymore but only rebooted.
229 virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer);
230
231 virtual void RemoveShutdownPolicyObserver(ShutdownPolicyObserver* observer);
232
233 // Determines whether the device is automatically rebooted when shut down as
234 // specified by the device policy |DeviceRebootOnShutdown|. This function
235 // asynchronously calls |callback| once a trusted policy becomes available.
236 virtual void ShouldRebootOnShutdown(const RebootOnShutdownCallback& callback);
237
238 // Returns VPNDelegate. May return nullptr. 223 // Returns VPNDelegate. May return nullptr.
239 virtual VPNDelegate* GetVPNDelegate() const; 224 virtual VPNDelegate* GetVPNDelegate() const;
240 225
241 // Creates a system tray item for display rotation lock. 226 // Creates a system tray item for display rotation lock.
242 // TODO(jamescook): Remove this when mus has support for display management 227 // TODO(jamescook): Remove this when mus has support for display management
243 // and we have a DisplayManager equivalent. See http://crbug.com/548429 228 // and we have a DisplayManager equivalent. See http://crbug.com/548429
244 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( 229 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem(
245 SystemTray* tray); 230 SystemTray* tray);
246 }; 231 };
247 232
248 } // namespace ash 233 } // namespace ash
249 234
250 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ 235 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_
OLDNEW
« no previous file with comments | « ash/common/system/tiles/tray_tiles.cc ('k') | ash/common/system/tray/system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698