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

Side by Side Diff: chromeos/dbus/fake_cryptohome_client.cc

Issue 2808423002: cros: Show dircryto migration banner (Closed)
Patch Set: add a test, fix nits 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 unified diff | Download patch
« no previous file with comments | « chromeos/dbus/fake_cryptohome_client.h ('k') | chromeos/dbus/mock_cryptohome_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 const ProtobufMethodCallback& callback) { 608 const ProtobufMethodCallback& callback) {
609 ReturnProtobufMethodCallback(cryptohome::BaseReply(), callback); 609 ReturnProtobufMethodCallback(cryptohome::BaseReply(), callback);
610 } 610 }
611 611
612 void FakeCryptohomeClient::SetFirmwareManagementParametersInTpm( 612 void FakeCryptohomeClient::SetFirmwareManagementParametersInTpm(
613 const cryptohome::SetFirmwareManagementParametersRequest& request, 613 const cryptohome::SetFirmwareManagementParametersRequest& request,
614 const ProtobufMethodCallback& callback) { 614 const ProtobufMethodCallback& callback) {
615 ReturnProtobufMethodCallback(cryptohome::BaseReply(), callback); 615 ReturnProtobufMethodCallback(cryptohome::BaseReply(), callback);
616 } 616 }
617 617
618 void FakeCryptohomeClient::NeedsDircryptoMigration(
619 const cryptohome::Identification& cryptohome_id,
620 const BoolDBusMethodCallback& callback) {
621 base::ThreadTaskRunnerHandle::Get()->PostTask(
622 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS,
623 needs_dircrypto_migration_));
624 }
625
618 void FakeCryptohomeClient::SetServiceIsAvailable(bool is_available) { 626 void FakeCryptohomeClient::SetServiceIsAvailable(bool is_available) {
619 service_is_available_ = is_available; 627 service_is_available_ = is_available;
620 if (is_available) { 628 if (is_available) {
621 std::vector<WaitForServiceToBeAvailableCallback> callbacks; 629 std::vector<WaitForServiceToBeAvailableCallback> callbacks;
622 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); 630 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_);
623 for (size_t i = 0; i < callbacks.size(); ++i) 631 for (size_t i = 0; i < callbacks.size(); ++i)
624 callbacks[i].Run(is_available); 632 callbacks[i].Run(is_available);
625 } 633 }
626 } 634 }
627 635
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 if (!dircrypto_migration_progress_handler_.is_null()) { 704 if (!dircrypto_migration_progress_handler_.is_null()) {
697 base::ThreadTaskRunnerHandle::Get()->PostTask( 705 base::ThreadTaskRunnerHandle::Get()->PostTask(
698 FROM_HERE, base::Bind(dircrypto_migration_progress_handler_, 706 FROM_HERE, base::Bind(dircrypto_migration_progress_handler_,
699 cryptohome::DIRCRYPTO_MIGRATION_IN_PROGRESS, 707 cryptohome::DIRCRYPTO_MIGRATION_IN_PROGRESS,
700 dircrypto_migration_progress_, 708 dircrypto_migration_progress_,
701 kDircryptoMigrationMaxProgress)); 709 kDircryptoMigrationMaxProgress));
702 } 710 }
703 } 711 }
704 712
705 } // namespace chromeos 713 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_cryptohome_client.h ('k') | chromeos/dbus/mock_cryptohome_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698