OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_PASSWORD_STORE_MAC_INTERNAL_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_INTERNAL_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_INTERNAL_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_INTERNAL_H_ |
7 | 7 |
8 #include <Security/Security.h> | 8 #include <Security/Security.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // Changes the password for keychain_item to |password|; returns true if the | 94 // Changes the password for keychain_item to |password|; returns true if the |
95 // password was successfully changed. | 95 // password was successfully changed. |
96 bool SetKeychainItemPassword(const SecKeychainItemRef& keychain_item, | 96 bool SetKeychainItemPassword(const SecKeychainItemRef& keychain_item, |
97 const std::string& password); | 97 const std::string& password); |
98 | 98 |
99 // Sets the creator code of keychain_item to creator_code; returns true if the | 99 // Sets the creator code of keychain_item to creator_code; returns true if the |
100 // creator code was successfully set. | 100 // creator code was successfully set. |
101 bool SetKeychainItemCreatorCode(const SecKeychainItemRef& keychain_item, | 101 bool SetKeychainItemCreatorCode(const SecKeychainItemRef& keychain_item, |
102 OSType creator_code); | 102 OSType creator_code); |
103 | 103 |
| 104 // Returns the creator code to be used for a Keychain search, depending on |
| 105 // whether this object was instructed to search only for items it created. |
| 106 // If searches should be restricted in this way, the application-specific |
| 107 // creator code will be returned. Otherwise, 0 will be returned, indicating |
| 108 // a search of all items, regardless of creator. |
| 109 OSType CreatorCodeForSearch(); |
| 110 |
104 const MacKeychain* keychain_; | 111 const MacKeychain* keychain_; |
105 | 112 |
106 // If true, Keychain searches are restricted to items created by Chrome. | 113 // If true, Keychain searches are restricted to items created by Chrome. |
107 bool finds_only_owned_; | 114 bool finds_only_owned_; |
108 | 115 |
109 DISALLOW_COPY_AND_ASSIGN(MacKeychainPasswordFormAdapter); | 116 DISALLOW_COPY_AND_ASSIGN(MacKeychainPasswordFormAdapter); |
110 }; | 117 }; |
111 | 118 |
112 namespace internal_keychain_helpers { | 119 namespace internal_keychain_helpers { |
113 | 120 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // Fills in the passwords for as many of the forms in |database_forms| as | 154 // Fills in the passwords for as many of the forms in |database_forms| as |
148 // possible using entries from |keychain| and returns them. On return, | 155 // possible using entries from |keychain| and returns them. On return, |
149 // |database_forms| will contain only the forms for which no password was found. | 156 // |database_forms| will contain only the forms for which no password was found. |
150 std::vector<webkit_glue::PasswordForm*> GetPasswordsForForms( | 157 std::vector<webkit_glue::PasswordForm*> GetPasswordsForForms( |
151 const MacKeychain& keychain, | 158 const MacKeychain& keychain, |
152 std::vector<webkit_glue::PasswordForm*>* database_forms); | 159 std::vector<webkit_glue::PasswordForm*>* database_forms); |
153 | 160 |
154 } // internal_keychain_helpers | 161 } // internal_keychain_helpers |
155 | 162 |
156 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_INTERNAL_H_ | 163 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_INTERNAL_H_ |
OLD | NEW |