Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: chrome/browser/password_manager/password_store_mac.cc

Issue 347583004: PasswordStore refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store_mac.h ('k') | chrome/browser/password_manager/password_store_x.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698