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

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

Issue 911323003: Simplify GetLoginsRequest, and let PasswordStore::GetLoginsImpl take scoped_ptr<GetLoginsRequest> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ps_fill_logins
Patch Set: Fix another Win compiler error. Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_store_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 if (!database_forms.empty()) { 1079 if (!database_forms.empty()) {
1080 RemoveDatabaseForms(&database_forms); 1080 RemoveDatabaseForms(&database_forms);
1081 NotifyLoginsChanged(FormsToRemoveChangeList(database_forms.get())); 1081 NotifyLoginsChanged(FormsToRemoveChangeList(database_forms.get()));
1082 } 1082 }
1083 1083
1084 return matched_forms.Pass(); 1084 return matched_forms.Pass();
1085 } 1085 }
1086 1086
1087 void PasswordStoreMac::GetBlacklistLoginsImpl( 1087 void PasswordStoreMac::GetBlacklistLoginsImpl(
1088 scoped_ptr<PasswordStore::GetLoginsRequest> request) { 1088 scoped_ptr<PasswordStore::GetLoginsRequest> request) {
1089 DCHECK(request->result()->empty()); 1089 ScopedVector<autofill::PasswordForm> obtained_forms;
1090 FillBlacklistLogins(request->result()); 1090 FillBlacklistLogins(&obtained_forms);
1091 ForwardLoginsResult(request.Pass()); 1091 request->NotifyConsumerWithResults(obtained_forms.Pass());
1092 } 1092 }
1093 1093
1094 void PasswordStoreMac::GetAutofillableLoginsImpl( 1094 void PasswordStoreMac::GetAutofillableLoginsImpl(
1095 scoped_ptr<PasswordStore::GetLoginsRequest> request) { 1095 scoped_ptr<PasswordStore::GetLoginsRequest> request) {
1096 DCHECK(request->result()->empty()); 1096 ScopedVector<autofill::PasswordForm> obtained_forms;
1097 FillAutofillableLogins(request->result()); 1097 FillAutofillableLogins(&obtained_forms);
1098 ForwardLoginsResult(request.Pass()); 1098 request->NotifyConsumerWithResults(obtained_forms.Pass());
1099 } 1099 }
1100 1100
1101 bool PasswordStoreMac::FillAutofillableLogins( 1101 bool PasswordStoreMac::FillAutofillableLogins(
1102 ScopedVector<autofill::PasswordForm>* forms) { 1102 ScopedVector<autofill::PasswordForm>* forms) {
1103 DCHECK(thread_->message_loop() == base::MessageLoop::current()); 1103 DCHECK(thread_->message_loop() == base::MessageLoop::current());
1104 1104
1105 ScopedVector<PasswordForm> database_forms; 1105 ScopedVector<PasswordForm> database_forms;
1106 if (!login_metadata_db_ || 1106 if (!login_metadata_db_ ||
1107 !login_metadata_db_->GetAutofillableLogins(&database_forms)) 1107 !login_metadata_db_->GetAutofillableLogins(&database_forms))
1108 return false; 1108 return false;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 ScopedVector<PasswordForm> forms_with_keychain_entry; 1186 ScopedVector<PasswordForm> forms_with_keychain_entry;
1187 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, 1187 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms,
1188 &forms_with_keychain_entry); 1188 &forms_with_keychain_entry);
1189 1189
1190 // Clean up any orphaned database entries. 1190 // Clean up any orphaned database entries.
1191 RemoveDatabaseForms(&database_forms); 1191 RemoveDatabaseForms(&database_forms);
1192 1192
1193 // Move the orphaned DB forms to the output parameter. 1193 // Move the orphaned DB forms to the output parameter.
1194 AppendSecondToFirst(orphaned_forms, &database_forms); 1194 AppendSecondToFirst(orphaned_forms, &database_forms);
1195 } 1195 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_store_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698