| Index: chrome/browser/password_manager/password_store_mac.cc
|
| diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc
|
| index b31cd516f4606f56567ee0419c340bd65e6aa4c9..2b584a677c02c8033668b94aeac97b4e24b2dcd7 100644
|
| --- a/chrome/browser/password_manager/password_store_mac.cc
|
| +++ b/chrome/browser/password_manager/password_store_mac.cc
|
| @@ -27,6 +27,7 @@
|
| #include "components/password_manager/core/browser/password_store_change.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "crypto/apple_keychain.h"
|
| +#include "url/origin.h"
|
|
|
| using autofill::PasswordForm;
|
| using crypto::AppleKeychain;
|
| @@ -331,7 +332,7 @@ bool FillPasswordFormFromKeychainItem(const AppleKeychain& keychain,
|
| attrInfo.tag = tags;
|
| attrInfo.format = NULL;
|
|
|
| - SecKeychainAttributeList *attrList;
|
| + SecKeychainAttributeList* attrList;
|
| UInt32 password_length;
|
|
|
| // If |extract_password_data| is false, do not pass in a reference to
|
| @@ -1132,6 +1133,34 @@ PasswordStoreChangeList PasswordStoreMac::RemoveLoginImpl(
|
| return changes;
|
| }
|
|
|
| +PasswordStoreChangeList PasswordStoreMac::RemoveLoginsByOriginAndTimeImpl(
|
| + const url::Origin& origin,
|
| + base::Time delete_begin,
|
| + base::Time delete_end) {
|
| + PasswordStoreChangeList changes;
|
| + ScopedVector<PasswordForm> forms_to_consider;
|
| + ScopedVector<PasswordForm> forms_to_remove;
|
| + if (login_metadata_db_ &&
|
| + login_metadata_db_->GetLoginsCreatedBetween(delete_begin, delete_end,
|
| + &forms_to_consider)) {
|
| + MoveAllFormsOut(
|
| + &forms_to_consider,
|
| + [this, &origin, &forms_to_remove](
|
| + scoped_ptr<autofill::PasswordForm> form_to_consider) {
|
| + if (origin.IsSameOriginWith(url::Origin(form_to_consider->origin)) &&
|
| + login_metadata_db_->RemoveLogin(*form_to_consider))
|
| + forms_to_remove.push_back(form_to_consider.Pass());
|
| + });
|
| + if (!forms_to_remove.empty()) {
|
| + RemoveKeychainForms(forms_to_remove.get());
|
| + CleanOrphanedForms(&forms_to_remove); // Add the orphaned forms.
|
| + changes = FormsToRemoveChangeList(forms_to_remove.get());
|
| + LogStatsForBulkDeletion(changes.size());
|
| + }
|
| + }
|
| + return changes;
|
| +}
|
| +
|
| PasswordStoreChangeList PasswordStoreMac::RemoveLoginsCreatedBetweenImpl(
|
| base::Time delete_begin,
|
| base::Time delete_end) {
|
|
|