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

Unified Diff: chrome/browser/chromeos/settings/shutdown_policy_handler.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/settings/shutdown_policy_handler.h
diff --git a/chrome/browser/chromeos/settings/shutdown_policy_handler.h b/chrome/browser/chromeos/settings/shutdown_policy_handler.h
index a13dfe9bf6c74de7b2d242a779b2962127f8ef86..c2c290a264cf3b49c9133056ae8b5c8875561c1d 100644
--- a/chrome/browser/chromeos/settings/shutdown_policy_handler.h
+++ b/chrome/browser/chromeos/settings/shutdown_policy_handler.h
@@ -19,12 +19,8 @@ namespace chromeos {
// calling its OnShutdownPolicyChanged method with the new state of the policy.
class ShutdownPolicyHandler {
public:
- // This callback is passed to CheckIfRebootOnShutdown, which invokes it with
- // the current state of the |DeviceRebootOnShutdown| policy once a trusted of
- // policies is established.
- using RebootOnShutdownCallback = base::Callback<void(bool)>;
-
// This delegate is called when the |DeviceRebootOnShutdown| policy changes.
+ // NotifyDelegateWithShutdownPolicy() can manually request a notification.
class Delegate {
public:
virtual void OnShutdownPolicyChanged(bool reboot_on_shutdown) = 0;
@@ -36,18 +32,11 @@ class ShutdownPolicyHandler {
ShutdownPolicyHandler(CrosSettings* cros_settings, Delegate* delegate);
~ShutdownPolicyHandler();
- // Once a trusted set of policies is established, this function calls
- // |callback| with the trusted state of the |DeviceRebootOnShutdown| policy.
- void CheckIfRebootOnShutdown(const RebootOnShutdownCallback& callback);
-
- // Resets the policy subscription and clears the delegate.
- void Shutdown();
+ // Once a trusted set of policies is established, this function notifies
+ // |delegate_| with the trusted state of the |DeviceRebootOnShutdown| policy.
+ void NotifyDelegateWithShutdownPolicy();
private:
- void CallDelegate(bool reboot_on_shutdown);
-
- void OnShutdownPolicyChanged();
-
CrosSettings* cros_settings_;
Delegate* delegate_;

Powered by Google App Engine
This is Rietveld 408576698