| 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 #include "chrome/browser/password_manager/password_store_mac.h" | 5 #include "chrome/browser/password_manager/password_store_mac.h" |
| 6 #include "chrome/browser/password_manager/password_store_mac_internal.h" | 6 #include "chrome/browser/password_manager/password_store_mac_internal.h" |
| 7 | 7 |
| 8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 owned_keychain_adapter.RemovePassword(form); | 926 owned_keychain_adapter.RemovePassword(form); |
| 927 } | 927 } |
| 928 } | 928 } |
| 929 | 929 |
| 930 changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form)); | 930 changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form)); |
| 931 } | 931 } |
| 932 return changes; | 932 return changes; |
| 933 } | 933 } |
| 934 | 934 |
| 935 PasswordStoreChangeList PasswordStoreMac::RemoveLoginsCreatedBetweenImpl( | 935 PasswordStoreChangeList PasswordStoreMac::RemoveLoginsCreatedBetweenImpl( |
| 936 const base::Time& delete_begin, const base::Time& delete_end) { | 936 base::Time delete_begin, |
| 937 base::Time delete_end) { |
| 937 PasswordStoreChangeList changes; | 938 PasswordStoreChangeList changes; |
| 938 std::vector<PasswordForm*> forms; | 939 std::vector<PasswordForm*> forms; |
| 939 if (login_metadata_db_->GetLoginsCreatedBetween(delete_begin, delete_end, | 940 if (login_metadata_db_->GetLoginsCreatedBetween(delete_begin, delete_end, |
| 940 &forms)) { | 941 &forms)) { |
| 941 if (login_metadata_db_->RemoveLoginsCreatedBetween(delete_begin, | 942 if (login_metadata_db_->RemoveLoginsCreatedBetween(delete_begin, |
| 942 delete_end)) { | 943 delete_end)) { |
| 943 // We can't delete from the Keychain by date because we may be sharing | 944 // We can't delete from the Keychain by date because we may be sharing |
| 944 // items with database entries that weren't in the delete range. Instead, | 945 // items with database entries that weren't in the delete range. Instead, |
| 945 // we find all the Keychain items we own but aren't using any more and | 946 // we find all the Keychain items we own but aren't using any more and |
| 946 // delete those. | 947 // delete those. |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 | 1154 |
| 1154 void PasswordStoreMac::RemoveKeychainForms( | 1155 void PasswordStoreMac::RemoveKeychainForms( |
| 1155 const std::vector<PasswordForm*>& forms) { | 1156 const std::vector<PasswordForm*>& forms) { |
| 1156 MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get()); | 1157 MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get()); |
| 1157 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); | 1158 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); |
| 1158 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); | 1159 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); |
| 1159 i != forms.end(); ++i) { | 1160 i != forms.end(); ++i) { |
| 1160 owned_keychain_adapter.RemovePassword(**i); | 1161 owned_keychain_adapter.RemovePassword(**i); |
| 1161 } | 1162 } |
| 1162 } | 1163 } |
| OLD | NEW |