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

Unified Diff: ash/system/tray/system_tray_delegate.h

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reduced scope of CL (ash only now, removed webui changes) Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: ash/system/tray/system_tray_delegate.h
diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h
index b840e48fc80ec9562a749852738157a65834f194..ac98951b81060c3360db1961e9cdf5e8b8a1f731 100644
--- a/ash/system/tray/system_tray_delegate.h
+++ b/ash/system/tray/system_tray_delegate.h
@@ -25,6 +25,7 @@ class TimeTicks;
namespace ash {
class CustodianInfoTrayObserver;
+class ShutdownPolicyObserver;
struct ASH_EXPORT NetworkIconInfo {
NetworkIconInfo();
@@ -53,7 +54,7 @@ struct ASH_EXPORT BluetoothDeviceInfo {
bool paired;
};
-typedef std::vector<BluetoothDeviceInfo> BluetoothDeviceList;
+using BluetoothDeviceList = std::vector<BluetoothDeviceInfo>;
struct ASH_EXPORT IMEPropertyInfo {
IMEPropertyInfo();
@@ -64,7 +65,7 @@ struct ASH_EXPORT IMEPropertyInfo {
base::string16 name;
};
-typedef std::vector<IMEPropertyInfo> IMEPropertyInfoList;
+using IMEPropertyInfoList = std::vector<IMEPropertyInfo>;
struct ASH_EXPORT IMEInfo {
IMEInfo();
@@ -94,10 +95,12 @@ struct ASH_EXPORT UpdateInfo {
bool factory_reset_required;
};
-typedef std::vector<IMEInfo> IMEInfoList;
+using IMEInfoList = std::vector<IMEInfo>;
class VolumeControlDelegate;
+using RebootOnShutdownCallback = base::Callback<void(bool)>;
+
namespace tray {
class UserAccountsDelegate;
} // namespace tray
@@ -205,9 +208,6 @@ class ASH_EXPORT SystemTrayDelegate {
// Shows login UI to add other users to this session.
virtual void ShowUserLogin() = 0;
- // Attempts to shut down the system.
- virtual void ShutDown() = 0;
-
// Attempts to sign out the user.
virtual void SignOut() = 0;
@@ -303,6 +303,20 @@ class ASH_EXPORT SystemTrayDelegate {
virtual void RemoveCustodianInfoTrayObserver(
CustodianInfoTrayObserver* observer) = 0;
+
+ // Adds an observer whose |OnShutdownPolicyChanged| function is called when
+ // the |DeviceRebootOnShutdown| policy changes. If this policy is set to
+ // true, a device cannot be shut down anymore but only rebooted.
+ virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer) = 0;
+
+ virtual void RemoveShutdownPolicyObserver(
+ ShutdownPolicyObserver* observer) = 0;
+
+ // Determines whether the device is automatically rebooted when shut down as
+ // specified by the device policy |DeviceRebootOnShutdown|. This function
+ // asynchronously calls |callback| once a trusted policy becomes available.
+ virtual void ShouldRebootOnShutdown(
+ const RebootOnShutdownCallback& callback) = 0;
};
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698