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 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 void PasswordStoreMac::GetAutofillableLoginsImpl( | 1097 void PasswordStoreMac::GetAutofillableLoginsImpl( |
1098 scoped_ptr<PasswordStore::GetLoginsRequest> request) { | 1098 scoped_ptr<PasswordStore::GetLoginsRequest> request) { |
1099 DCHECK(request->result()->empty()); | 1099 DCHECK(request->result()->empty()); |
1100 FillAutofillableLogins(request->result()); | 1100 FillAutofillableLogins(request->result()); |
1101 ForwardLoginsResult(request.Pass()); | 1101 ForwardLoginsResult(request.Pass()); |
1102 } | 1102 } |
1103 | 1103 |
1104 bool PasswordStoreMac::FillAutofillableLogins( | 1104 bool PasswordStoreMac::FillAutofillableLogins( |
1105 ScopedVector<autofill::PasswordForm>* forms) { | 1105 ScopedVector<autofill::PasswordForm>* forms) { |
1106 DCHECK(thread_->message_loop() == base::MessageLoop::current()); | 1106 DCHECK(thread_->message_loop() == base::MessageLoop::current()); |
| 1107 forms->clear(); |
1107 | 1108 |
1108 ScopedVector<PasswordForm> database_forms; | 1109 ScopedVector<PasswordForm> database_forms; |
1109 if (!login_metadata_db_ || | 1110 if (!login_metadata_db_ || |
1110 !login_metadata_db_->GetAutofillableLogins(&database_forms)) | 1111 !login_metadata_db_->GetAutofillableLogins(&database_forms)) |
1111 return false; | 1112 return false; |
1112 | 1113 |
1113 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, | 1114 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, |
1114 forms); | 1115 forms); |
1115 | 1116 |
1116 if (!database_forms.empty()) { | 1117 if (!database_forms.empty()) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 ScopedVector<PasswordForm> forms_with_keychain_entry; | 1190 ScopedVector<PasswordForm> forms_with_keychain_entry; |
1190 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, | 1191 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, |
1191 &forms_with_keychain_entry); | 1192 &forms_with_keychain_entry); |
1192 | 1193 |
1193 // Clean up any orphaned database entries. | 1194 // Clean up any orphaned database entries. |
1194 RemoveDatabaseForms(&database_forms); | 1195 RemoveDatabaseForms(&database_forms); |
1195 | 1196 |
1196 // Move the orphaned DB forms to the output parameter. | 1197 // Move the orphaned DB forms to the output parameter. |
1197 AppendSecondToFirst(orphaned_forms, &database_forms); | 1198 AppendSecondToFirst(orphaned_forms, &database_forms); |
1198 } | 1199 } |
OLD | NEW |