| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chromeos/dbus/fake_cryptohome_client.h" | 5 #include "chromeos/dbus/fake_cryptohome_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 void FakeCryptohomeClient::MountEx( | 526 void FakeCryptohomeClient::MountEx( |
| 527 const cryptohome::Identification& cryptohome_id, | 527 const cryptohome::Identification& cryptohome_id, |
| 528 const cryptohome::AuthorizationRequest& auth, | 528 const cryptohome::AuthorizationRequest& auth, |
| 529 const cryptohome::MountRequest& request, | 529 const cryptohome::MountRequest& request, |
| 530 const ProtobufMethodCallback& callback) { | 530 const ProtobufMethodCallback& callback) { |
| 531 cryptohome::BaseReply reply; | 531 cryptohome::BaseReply reply; |
| 532 cryptohome::MountReply* mount = | 532 cryptohome::MountReply* mount = |
| 533 reply.MutableExtension(cryptohome::MountReply::reply); | 533 reply.MutableExtension(cryptohome::MountReply::reply); |
| 534 mount->set_sanitized_username(GetStubSanitizedUsername(cryptohome_id)); | 534 mount->set_sanitized_username(GetStubSanitizedUsername(cryptohome_id)); |
| 535 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 535 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 536 switches::kTestEncryptionMigrationUI)) { | 536 switches::kTestEncryptionMigrationUI) && |
| 537 !request.to_migrate_from_ecryptfs()) { |
| 537 reply.set_error(cryptohome::CRYPTOHOME_ERROR_MOUNT_OLD_ENCRYPTION); | 538 reply.set_error(cryptohome::CRYPTOHOME_ERROR_MOUNT_OLD_ENCRYPTION); |
| 538 } | 539 } |
| 539 ReturnProtobufMethodCallback(reply, callback); | 540 ReturnProtobufMethodCallback(reply, callback); |
| 540 } | 541 } |
| 541 | 542 |
| 542 void FakeCryptohomeClient::AddKeyEx( | 543 void FakeCryptohomeClient::AddKeyEx( |
| 543 const cryptohome::Identification& cryptohome_id, | 544 const cryptohome::Identification& cryptohome_id, |
| 544 const cryptohome::AuthorizationRequest& auth, | 545 const cryptohome::AuthorizationRequest& auth, |
| 545 const cryptohome::AddKeyRequest& request, | 546 const cryptohome::AddKeyRequest& request, |
| 546 const ProtobufMethodCallback& callback) { | 547 const ProtobufMethodCallback& callback) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 if (!dircrypto_migration_progress_handler_.is_null()) { | 705 if (!dircrypto_migration_progress_handler_.is_null()) { |
| 705 base::ThreadTaskRunnerHandle::Get()->PostTask( | 706 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 706 FROM_HERE, base::Bind(dircrypto_migration_progress_handler_, | 707 FROM_HERE, base::Bind(dircrypto_migration_progress_handler_, |
| 707 cryptohome::DIRCRYPTO_MIGRATION_IN_PROGRESS, | 708 cryptohome::DIRCRYPTO_MIGRATION_IN_PROGRESS, |
| 708 dircrypto_migration_progress_, | 709 dircrypto_migration_progress_, |
| 709 kDircryptoMigrationMaxProgress)); | 710 kDircryptoMigrationMaxProgress)); |
| 710 } | 711 } |
| 711 } | 712 } |
| 712 | 713 |
| 713 } // namespace chromeos | 714 } // namespace chromeos |
| OLD | NEW |