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_PASSWORD_STORE_MAC_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Adds the given form to the Keychain if it's something we want to store | 77 // Adds the given form to the Keychain if it's something we want to store |
78 // there (i.e., not a blacklist entry). Returns true if the operation | 78 // there (i.e., not a blacklist entry). Returns true if the operation |
79 // succeeded (either we added successfully, or we didn't need to). | 79 // succeeded (either we added successfully, or we didn't need to). |
80 bool AddToKeychainIfNecessary(const autofill::PasswordForm& form); | 80 bool AddToKeychainIfNecessary(const autofill::PasswordForm& form); |
81 | 81 |
82 // Returns true if our database contains a form that exactly matches the given | 82 // Returns true if our database contains a form that exactly matches the given |
83 // keychain form. | 83 // keychain form. |
84 bool DatabaseHasFormMatchingKeychainForm( | 84 bool DatabaseHasFormMatchingKeychainForm( |
85 const autofill::PasswordForm& form); | 85 const autofill::PasswordForm& form); |
86 | 86 |
87 // Returns all the Keychain entries that we own but no longer have | |
88 // corresponding metadata for in our database. | |
89 // Caller is responsible for deleting the forms. | |
90 std::vector<autofill::PasswordForm*> GetUnusedKeychainForms(); | |
91 | |
92 // Removes the given forms from the database. | 87 // Removes the given forms from the database. |
93 void RemoveDatabaseForms( | 88 void RemoveDatabaseForms( |
94 const std::vector<autofill::PasswordForm*>& forms); | 89 const std::vector<autofill::PasswordForm*>& forms); |
95 | 90 |
96 // Removes the given forms from the Keychain. | 91 // Removes the given forms from the Keychain. |
97 void RemoveKeychainForms( | 92 void RemoveKeychainForms( |
98 const std::vector<autofill::PasswordForm*>& forms); | 93 const std::vector<autofill::PasswordForm*>& forms); |
99 | 94 |
100 scoped_ptr<crypto::AppleKeychain> keychain_; | 95 scoped_ptr<crypto::AppleKeychain> keychain_; |
101 scoped_ptr<password_manager::LoginDatabase> login_metadata_db_; | 96 scoped_ptr<password_manager::LoginDatabase> login_metadata_db_; |
102 | 97 |
103 // Thread that the synchronous methods are run on. | 98 // Thread that the synchronous methods are run on. |
104 scoped_ptr<base::Thread> thread_; | 99 scoped_ptr<base::Thread> thread_; |
105 | 100 |
106 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); | 101 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); |
107 }; | 102 }; |
108 | 103 |
109 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 104 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
OLD | NEW |