| 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..6c20330c8969d81983aebddac811ca88fdd23321 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,46 @@ 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);
|
| + if (done) {
|
| + *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 +372,52 @@ class CryptohomeLibraryStubImpl : public CryptohomeLibrary {
|
|
|
| void TpmClearStoredPassword() {}
|
|
|
| + bool InstallAttributesGet(const std::string& name, std::string* value) {
|
| + if (install_attrs_.find(name) != install_attrs_.end()) {
|
| + *value = install_attrs_[name];
|
| + return true;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + bool InstallAttributesSet(const std::string& name, const std::string& value) {
|
| + install_attrs_[name] = value;
|
| + return true;
|
| + }
|
| +
|
| + int InstallAttributesCount() {
|
| + return install_attrs_.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> install_attrs_;
|
| + bool locked_;
|
| DISALLOW_COPY_AND_ASSIGN(CryptohomeLibraryStubImpl);
|
| };
|
|
|
|
|