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

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

Issue 2842433002: cros: Prevent casual shut down and power save during migration. (Closed)
Patch Set: Update BUILD.gn to include PowerSaveBlocker. Created 3 years, 8 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: chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
index f5b5a212ec2627dab3d15be963fa3e2dcdce4c2b..1e194de6f08c714fe2b552a6745c6c85c34d4d05 100644
--- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENCRYPTION_MIGRATION_SCREEN_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENCRYPTION_MIGRATION_SCREEN_HANDLER_H_
+#include <memory>
+
#include "base/macros.h"
#include "chrome/browser/chromeos/login/screens/encryption_migration_screen_view.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
@@ -13,6 +15,10 @@
#include "chromeos/login/auth/user_context.h"
#include "third_party/cros_system_api/dbus/cryptohome/dbus-constants.h"
+namespace device {
+class PowerSaveBlocker;
+} // namespace device
+
namespace chromeos {
// WebUI implementation of EncryptionMigrationScreenView
@@ -69,6 +75,9 @@ class EncryptionMigrationScreenHandler : public EncryptionMigrationScreenView,
void OnMountExistingVault(bool success,
cryptohome::MountError return_code,
const std::string& mount_hash);
+ void StartBlockingPowerSave();
+ void StopBlockingPowerSave();
+
// Creates authorization key for MountEx method using |user_context_|.
cryptohome::KeyDefinition GetAuthKey();
@@ -101,6 +110,8 @@ class EncryptionMigrationScreenHandler : public EncryptionMigrationScreenView,
// sufficient.
bool should_migrate_on_enough_battery_ = false;
+ std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
+
base::WeakPtrFactory<EncryptionMigrationScreenHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(EncryptionMigrationScreenHandler);
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698