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

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

Issue 2811713002: Check the available storage size before starting encryption migration. (Closed)
Patch Set: Always check the available storage. 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 719af81c3bd736ec143aa05673c331d8e7f33a37..c2604b42f41f5614007deb85752958bd00152bef 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
@@ -27,6 +27,7 @@ class EncryptionMigrationScreenHandler : public EncryptionMigrationScreenView,
void SetUserContext(const UserContext& user_context) override;
void SetShouldResume(bool should_resume) override;
void SetContinueLoginCallback(ContinueLoginCallback callback) override;
+ void SetupInitialView() override;
// BaseScreenHandler implementation:
void DeclareLocalizedValues(
@@ -38,9 +39,11 @@ class EncryptionMigrationScreenHandler : public EncryptionMigrationScreenView,
// EncryptionMigrationUIState in JS code.
enum UIState {
INITIAL = 0,
- MIGRATING = 1,
- MIGRATION_SUCCEEDED = 2,
- MIGRATION_FAILED = 3
+ READY = 1,
+ MIGRATING = 2,
+ MIGRATION_SUCCEEDED = 3,
+ MIGRATION_FAILED = 4,
+ NOT_ENOUGH_STORAGE = 5,
};
// WebUIMessageHandler implementation:
@@ -55,6 +58,8 @@ class EncryptionMigrationScreenHandler : public EncryptionMigrationScreenView,
void UpdateUIState(UIState state);
// Requests cryptohome to start encryption migration.
+ void CheckAvailableStorage();
+ void OnGetAvailableStorage(int64_t size);
void StartMigration();
// Handlers for cryptohome API callbacks.
@@ -76,6 +81,9 @@ class EncryptionMigrationScreenHandler : public EncryptionMigrationScreenView,
// The callback which is used to log in to the session from the migration UI.
ContinueLoginCallback continue_login_callback_;
+ // True if the system should resume the previous incomplete migration.
+ bool should_resume_ = false;
+
base::WeakPtrFactory<EncryptionMigrationScreenHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(EncryptionMigrationScreenHandler);

Powered by Google App Engine
This is Rietveld 408576698