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

Side by Side Diff: chromeos/dbus/power_policy_controller.h

Issue 2912763003: cros: Prevent shut down on lid-close during migration. (Closed)
Patch Set: revert unrelated change Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ 5 #ifndef CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_
6 #define CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ 6 #define CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 // Unregisters a request previously created via an Add*WakeLock() call 106 // Unregisters a request previously created via an Add*WakeLock() call
107 // and sends an updated policy. 107 // and sends an updated policy.
108 void RemoveWakeLock(int id); 108 void RemoveWakeLock(int id);
109 109
110 // Adjusts policy while Chrome is exiting. The lid-closed action 110 // Adjusts policy while Chrome is exiting. The lid-closed action
111 // is overridden to ensure that the system doesn't suspend or shut 111 // is overridden to ensure that the system doesn't suspend or shut
112 // down. 112 // down.
113 void NotifyChromeIsExiting(); 113 void NotifyChromeIsExiting();
114 114
115 // Adjusts policy when the migration of a user homedir to a new
116 // encryption format starts or stops. While migration is active,
117 // the lid-closed action is overridden to ensure the system
118 // doesn't shut down.
119 void SetEncryptionMigrationActive(bool active);
120
115 // PowerManagerClient::Observer implementation: 121 // PowerManagerClient::Observer implementation:
116 void PowerManagerRestarted() override; 122 void PowerManagerRestarted() override;
117 123
118 private: 124 private:
119 explicit PowerPolicyController(PowerManagerClient* client); 125 explicit PowerPolicyController(PowerManagerClient* client);
120 ~PowerPolicyController() override; 126 ~PowerPolicyController() override;
121 127
122 friend class PowerPrefsTest; 128 friend class PowerPrefsTest;
123 129
124 // Details about a wake lock added via Add*WakeLock(). 130 // Details about a wake lock added via Add*WakeLock().
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // Should TYPE_SCREEN or TYPE_DIM entries in |wake_locks_| be honored? 172 // Should TYPE_SCREEN or TYPE_DIM entries in |wake_locks_| be honored?
167 // If false, screen wake locks are just treated as TYPE_SYSTEM instead. 173 // If false, screen wake locks are just treated as TYPE_SYSTEM instead.
168 bool honor_screen_wake_locks_; 174 bool honor_screen_wake_locks_;
169 175
170 // Next ID to be used by an Add*WakeLock() request. 176 // Next ID to be used by an Add*WakeLock() request.
171 int next_wake_lock_id_; 177 int next_wake_lock_id_;
172 178
173 // True if Chrome is in the process of exiting. 179 // True if Chrome is in the process of exiting.
174 bool chrome_is_exiting_; 180 bool chrome_is_exiting_;
175 181
182 // True if a user homedir is in the process of migrating encryption formats.
183 bool encryption_migration_active_;
184
176 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); 185 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController);
177 }; 186 };
178 187
179 } // namespace chromeos 188 } // namespace chromeos
180 189
181 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ 190 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698