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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chromeos/cryptohome/async_method_caller.h" | 9 #include "chromeos/cryptohome/async_method_caller.h" |
10 #include "chromeos/dbus/blocking_method_caller.h" | 10 #include "chromeos/dbus/blocking_method_caller.h" |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
847 kStubSystemSalt + arraysize(kStubSystemSalt) - 1); | 847 kStubSystemSalt + arraysize(kStubSystemSalt) - 1); |
848 return true; | 848 return true; |
849 } | 849 } |
850 | 850 |
851 // CryptohomeClient override. | 851 // CryptohomeClient override. |
852 virtual void GetSanitizedUsername( | 852 virtual void GetSanitizedUsername( |
853 const std::string& username, | 853 const std::string& username, |
854 const StringDBusMethodCallback& callback) OVERRIDE { | 854 const StringDBusMethodCallback& callback) OVERRIDE { |
855 // Even for stub implementation we have to return different values | 855 // Even for stub implementation we have to return different values |
856 // so that multi-profiles would work. | 856 // so that multi-profiles would work. |
857 // Keep this in sync with SessionManagerClientStubImpl::StorePolicyForUser. | |
Mattias Nissler (ping if slow)
2013/05/10 12:40:15
Then please make a static function somewhere that
Joao da Silva
2013/05/13 09:39:23
Done.
| |
857 std::string sanitized_username = username + "-profile"; | 858 std::string sanitized_username = username + "-profile"; |
858 MessageLoop::current()->PostTask( | 859 MessageLoop::current()->PostTask( |
859 FROM_HERE, | 860 FROM_HERE, |
860 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, sanitized_username)); | 861 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, sanitized_username)); |
861 } | 862 } |
862 | 863 |
863 // CryptohomeClient override. | 864 // CryptohomeClient override. |
864 virtual void AsyncMount(const std::string& username, | 865 virtual void AsyncMount(const std::string& username, |
865 const std::string& key, | 866 const std::string& key, |
866 int flags, | 867 int flags, |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1188 // static | 1189 // static |
1189 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type, | 1190 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type, |
1190 dbus::Bus* bus) { | 1191 dbus::Bus* bus) { |
1191 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 1192 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
1192 return new CryptohomeClientImpl(bus); | 1193 return new CryptohomeClientImpl(bus); |
1193 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 1194 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
1194 return new CryptohomeClientStubImpl(); | 1195 return new CryptohomeClientStubImpl(); |
1195 } | 1196 } |
1196 | 1197 |
1197 } // namespace chromeos | 1198 } // namespace chromeos |
OLD | NEW |