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

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: 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') | chromeos/dbus/power_policy_controller.h » ('J')
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..dd152d7b269c420b98ce1f53884ee0aa8cef7a83 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,16 @@ 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 poweroff on lid close during migration.
+ if (state == UIState::MIGRATING) {
StartBlockingPowerSave();
- else
+ if (PowerPolicyController::IsInitialize())
Daniel Erat 2017/05/30 13:39:42 i don't think that this code should ever run befor
dspaid 2017/05/30 23:37:22 Done.
+ PowerPolicyController::Get()->SetEncryptionMigrationActive(true);
+ } else {
StopBlockingPowerSave();
+ if (PowerPolicyController::IsInitialize())
+ PowerPolicyController::Get()->SetEncryptionMigrationActive(false);
+ }
}
void EncryptionMigrationScreenHandler::CheckAvailableStorage() {
« no previous file with comments | « no previous file | chromeos/dbus/power_policy_controller.h » ('j') | chromeos/dbus/power_policy_controller.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698