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

Unified Diff: chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc

Issue 2912763003: cros: Prevent shut down on lid-close during migration. (Closed)
Patch Set: revert unrelated change Created 3 years, 7 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
« no previous file with comments | « no previous file | chromeos/dbus/power_policy_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
index e47c7ad10f96d3a801b44b0f14e9630dd8d51b20..f6e284a174118f5385e57ba8255fd48877992f70 100644
--- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -29,6 +29,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/power_manager/power_supply_properties.pb.h"
#include "chromeos/dbus/power_manager_client.h"
+#include "chromeos/dbus/power_policy_controller.h"
#include "components/login/localized_values_builder.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_thread.h"
@@ -282,11 +283,14 @@ void EncryptionMigrationScreenHandler::UpdateUIState(UIState state) {
if (state == UIState::READY)
DBusThreadManager::Get()->GetPowerManagerClient()->RequestStatusUpdate();
- // We should block power save during migration.
- if (state == UIState::MIGRATING)
+ // We should block power save and not shut down on lid close during migration.
+ if (state == UIState::MIGRATING) {
StartBlockingPowerSave();
- else
+ PowerPolicyController::Get()->SetEncryptionMigrationActive(true);
+ } else {
StopBlockingPowerSave();
+ PowerPolicyController::Get()->SetEncryptionMigrationActive(false);
+ }
}
void EncryptionMigrationScreenHandler::CheckAvailableStorage() {
« no previous file with comments | « no previous file | chromeos/dbus/power_policy_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698