OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cryptohome_client.h" | 5 #include "chromeos/dbus/cryptohome_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "chromeos/cryptohome/async_method_caller.h" | 11 #include "chromeos/cryptohome/async_method_caller.h" |
12 #include "chromeos/dbus/blocking_method_caller.h" | 12 #include "chromeos/dbus/blocking_method_caller.h" |
13 #include "chromeos/dbus/fake_cryptohome_client.h" | |
14 #include "dbus/bus.h" | 13 #include "dbus/bus.h" |
15 #include "dbus/message.h" | 14 #include "dbus/message.h" |
16 #include "dbus/object_path.h" | 15 #include "dbus/object_path.h" |
17 #include "dbus/object_proxy.h" | 16 #include "dbus/object_proxy.h" |
18 #include "third_party/cros_system_api/dbus/service_constants.h" | 17 #include "third_party/cros_system_api/dbus/service_constants.h" |
19 | 18 |
20 namespace chromeos { | 19 namespace chromeos { |
21 | 20 |
22 namespace { | 21 namespace { |
23 | 22 |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 } // namespace | 938 } // namespace |
940 | 939 |
941 //////////////////////////////////////////////////////////////////////////////// | 940 //////////////////////////////////////////////////////////////////////////////// |
942 // CryptohomeClient | 941 // CryptohomeClient |
943 | 942 |
944 CryptohomeClient::CryptohomeClient() {} | 943 CryptohomeClient::CryptohomeClient() {} |
945 | 944 |
946 CryptohomeClient::~CryptohomeClient() {} | 945 CryptohomeClient::~CryptohomeClient() {} |
947 | 946 |
948 // static | 947 // static |
949 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type) { | 948 CryptohomeClient* CryptohomeClient::Create() { |
950 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 949 return new CryptohomeClientImpl(); |
951 return new CryptohomeClientImpl(); | |
952 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | |
953 return new FakeCryptohomeClient(); | |
954 } | 950 } |
955 | 951 |
956 // static | 952 // static |
957 std::string CryptohomeClient::GetStubSanitizedUsername( | 953 std::string CryptohomeClient::GetStubSanitizedUsername( |
958 const std::string& username) { | 954 const std::string& username) { |
959 return username + kUserIdStubHashSuffix; | 955 return username + kUserIdStubHashSuffix; |
960 } | 956 } |
961 | 957 |
962 } // namespace chromeos | 958 } // namespace chromeos |
OLD | NEW |