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