Chromium Code Reviews| Index: chrome/browser/chromeos/cros/cryptohome_library.cc |
| diff --git a/chrome/browser/chromeos/cros/cryptohome_library.cc b/chrome/browser/chromeos/cros/cryptohome_library.cc |
| index ac2d701791d8577768a343b6ce4e385cd8efed39..7850d4c6673a30351878b96779e152db5a106d02 100644 |
| --- a/chrome/browser/chromeos/cros/cryptohome_library.cc |
| +++ b/chrome/browser/chromeos/cros/cryptohome_library.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -162,6 +162,44 @@ class CryptohomeLibraryImpl : public CryptohomeLibrary { |
| chromeos::CryptohomeTpmClearStoredPassword(); |
| } |
| + bool InstallAttributesGet(const std::string& name, std::string* value) { |
| + char* local_value; |
| + bool done = |
| + chromeos::CryptohomeInstallAttributesGet(name.c_str(), &local_value); |
| + *value = local_value; |
| + chromeos::CryptohomeFreeString(local_value); |
| + return done; |
| + } |
| + |
| + bool InstallAttributesSet(const std::string& name, const std::string& value) { |
| + return chromeos::CryptohomeInstallAttributesSet(name.c_str(), |
| + value.c_str()); |
| + } |
| + |
| + int InstallAttributesCount() { |
| + return chromeos::CryptohomeInstallAttributesCount(); |
| + } |
| + |
| + bool InstallAttributesFinalize() { |
| + return chromeos::CryptohomeInstallAttributesFinalize(); |
| + } |
| + |
| + bool InstallAttributesIsReady() { |
| + return chromeos::CryptohomeInstallAttributesIsReady(); |
| + } |
| + |
| + bool InstallAttributesIsSecure() { |
| + return chromeos::CryptohomeInstallAttributesIsSecure(); |
| + } |
| + |
| + bool InstallAttributesIsInvalid() { |
| + return chromeos::CryptohomeInstallAttributesIsInvalid(); |
| + } |
| + |
| + bool InstallAttributesIsFirstInstall() { |
| + return chromeos::CryptohomeInstallAttributesIsFirstInstall(); |
| + } |
| + |
| private: |
| static void Handler(const chromeos::CryptohomeAsyncCallStatus& event, |
| void* cryptohome_library) { |
| @@ -332,11 +370,52 @@ class CryptohomeLibraryStubImpl : public CryptohomeLibrary { |
| void TpmClearStoredPassword() {} |
| + bool InstallAttributesGet(const std::string& name, std::string* value) { |
| + if (lockbox_.find(name) != lockbox_.end()) { |
| + *value = lockbox_[name]; |
| + return true; |
| + } |
| + return false; |
| + } |
| + |
| + bool InstallAttributesSet(const std::string& name, const std::string& value) { |
| + lockbox_[name] = value; |
|
kmixter1
2011/04/14 16:52:22
why? Is this just until the actual implementation
|
| + return true; |
| + } |
| + |
| + int InstallAttributesCount() { |
| + return lockbox_.size(); |
| + } |
| + |
| + bool InstallAttributesFinalize() { |
| + locked_ = true; |
| + return true; |
| + } |
| + |
| + bool InstallAttributesIsReady() { |
| + return true; |
| + } |
| + |
| + bool InstallAttributesIsSecure() { |
| + return locked_; |
| + } |
| + |
| + bool InstallAttributesIsInvalid() { |
| + return false; |
| + } |
| + |
| + bool InstallAttributesIsFirstInstall() { |
| + return false; |
| + } |
| + |
| private: |
| static void DoStubCallback(Delegate* callback) { |
| if (callback) |
| callback->OnComplete(true, kCryptohomeMountErrorNone); |
| } |
| + |
| + std::map<std::string, std::string> lockbox_; |
| + bool locked_; |
| DISALLOW_COPY_AND_ASSIGN(CryptohomeLibraryStubImpl); |
| }; |