OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_han
dler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_han
dler.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 // We should block power save during migration. | 261 // We should block power save during migration. |
262 if (state == UIState::MIGRATING) | 262 if (state == UIState::MIGRATING) |
263 StartBlockingPowerSave(); | 263 StartBlockingPowerSave(); |
264 else | 264 else |
265 StopBlockingPowerSave(); | 265 StopBlockingPowerSave(); |
266 } | 266 } |
267 | 267 |
268 void EncryptionMigrationScreenHandler::CheckAvailableStorage() { | 268 void EncryptionMigrationScreenHandler::CheckAvailableStorage() { |
269 base::PostTaskWithTraitsAndReplyWithResult( | 269 base::PostTaskWithTraitsAndReplyWithResult( |
270 FROM_HERE, | 270 FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, |
271 base::TaskTraits().MayBlock().WithPriority( | |
272 base::TaskPriority::USER_VISIBLE), | |
273 base::Bind(&base::SysInfo::AmountOfFreeDiskSpace, | 271 base::Bind(&base::SysInfo::AmountOfFreeDiskSpace, |
274 base::FilePath(kCheckStoragePath)), | 272 base::FilePath(kCheckStoragePath)), |
275 base::Bind(&EncryptionMigrationScreenHandler::OnGetAvailableStorage, | 273 base::Bind(&EncryptionMigrationScreenHandler::OnGetAvailableStorage, |
276 weak_ptr_factory_.GetWeakPtr())); | 274 weak_ptr_factory_.GetWeakPtr())); |
277 } | 275 } |
278 | 276 |
279 void EncryptionMigrationScreenHandler::OnGetAvailableStorage(int64_t size) { | 277 void EncryptionMigrationScreenHandler::OnGetAvailableStorage(int64_t size) { |
280 if (size >= kMinimumAvailableStorage || IsTestingUI()) { | 278 if (size >= kMinimumAvailableStorage || IsTestingUI()) { |
281 if (should_resume_) { | 279 if (should_resume_) { |
282 RecordFirstScreen(FirstScreen::FIRST_SCREEN_RESUME); | 280 RecordFirstScreen(FirstScreen::FIRST_SCREEN_RESUME); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 break; | 428 break; |
431 } | 429 } |
432 } | 430 } |
433 | 431 |
434 void EncryptionMigrationScreenHandler::OnMigrationRequested(bool success) { | 432 void EncryptionMigrationScreenHandler::OnMigrationRequested(bool success) { |
435 LOG_IF(ERROR, !success) << "Requesting MigrateToDircrypto failed."; | 433 LOG_IF(ERROR, !success) << "Requesting MigrateToDircrypto failed."; |
436 UpdateUIState(UIState::MIGRATION_FAILED); | 434 UpdateUIState(UIState::MIGRATION_FAILED); |
437 } | 435 } |
438 | 436 |
439 } // namespace chromeos | 437 } // namespace chromeos |
OLD | NEW |