| 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..ed2f36cc4899ff5023415dea44deac30125a0798 100644
|
| --- a/chrome/browser/chromeos/cros/cryptohome_library.cc
|
| +++ b/chrome/browser/chromeos/cros/cryptohome_library.cc
|
| @@ -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;
|
| + 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);
|
| };
|
|
|
|
|