| 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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 | 12 |
| 13 namespace crypto { |
| 13 class MacKeychain; | 14 class MacKeychain; |
| 15 } // namespace crypto |
| 14 | 16 |
| 15 class EncryptorPassword { | 17 class EncryptorPassword { |
| 16 public: | 18 public: |
| 17 explicit EncryptorPassword(const MacKeychain& keychain) | 19 explicit EncryptorPassword(const crypto::MacKeychain& keychain) |
| 18 : keychain_(keychain) { | 20 : keychain_(keychain) { |
| 19 } | 21 } |
| 20 | 22 |
| 21 // Get the Encryptor password for this system. If no password exists | 23 // Get the Encryptor password for this system. If no password exists |
| 22 // in the Keychain then one is generated, stored in the Mac keychain, and | 24 // in the Keychain then one is generated, stored in the Mac keychain, and |
| 23 // returned. | 25 // returned. |
| 24 // If one exists then it is fetched from the Keychain and returned. | 26 // If one exists then it is fetched from the Keychain and returned. |
| 25 // If the user disallows access to the Keychain (or an error occurs) then an | 27 // If the user disallows access to the Keychain (or an error occurs) then an |
| 26 // empty string is returned. | 28 // empty string is returned. |
| 27 std::string GetEncryptorPassword() const; | 29 std::string GetEncryptorPassword() const; |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 DISALLOW_COPY_AND_ASSIGN(EncryptorPassword); | 32 DISALLOW_COPY_AND_ASSIGN(EncryptorPassword); |
| 31 const MacKeychain& keychain_; | 33 const crypto::MacKeychain& keychain_; |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 #endif // CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ | 36 #endif // CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ |
| OLD | NEW |