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_win.h" | 5 #include "chrome/browser/password_manager/password_store_win.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 void PasswordStoreWin::ShutdownOnUIThread() { | 192 void PasswordStoreWin::ShutdownOnUIThread() { |
193 BrowserThread::PostTask( | 193 BrowserThread::PostTask( |
194 BrowserThread::DB, FROM_HERE, | 194 BrowserThread::DB, FROM_HERE, |
195 base::Bind(&PasswordStoreWin::ShutdownOnDBThread, this)); | 195 base::Bind(&PasswordStoreWin::ShutdownOnDBThread, this)); |
196 PasswordStoreDefault::ShutdownOnUIThread(); | 196 PasswordStoreDefault::ShutdownOnUIThread(); |
197 } | 197 } |
198 | 198 |
199 void PasswordStoreWin::GetLoginsImpl(const PasswordForm& form, | 199 void PasswordStoreWin::GetLoginsImpl(const PasswordForm& form, |
200 AuthorizationPromptPolicy prompt_policy, | |
201 scoped_ptr<GetLoginsRequest> request) { | 200 scoped_ptr<GetLoginsRequest> request) { |
202 // When importing from IE7, the credentials are first stored into a temporary | 201 // When importing from IE7, the credentials are first stored into a temporary |
203 // Web SQL database. Then, after each GetLogins() request that does not yield | 202 // Web SQL database. Then, after each GetLogins() request that does not yield |
204 // any matches from the LoginDatabase, the matching credentials in the Web SQL | 203 // any matches from the LoginDatabase, the matching credentials in the Web SQL |
205 // database, if any, are returned as results instead, and simultaneously get | 204 // database, if any, are returned as results instead, and simultaneously get |
206 // moved to the LoginDatabase, so next time they will be found immediately. | 205 // moved to the LoginDatabase, so next time they will be found immediately. |
207 // TODO(engedy): Make the IE7-specific code synchronous, so FillMatchingLogins | 206 // TODO(engedy): Make the IE7-specific code synchronous, so FillMatchingLogins |
208 // can be overridden instead. See: https://crbug.com/78830. | 207 // can be overridden instead. See: https://crbug.com/78830. |
209 // TODO(engedy): Credentials should be imported into the LoginDatabase in the | 208 // TODO(engedy): Credentials should be imported into the LoginDatabase in the |
210 // first place. See: https://crbug.com/456119. | 209 // first place. See: https://crbug.com/456119. |
211 ScopedVector<autofill::PasswordForm> matched_forms( | 210 ScopedVector<autofill::PasswordForm> matched_forms(FillMatchingLogins(form)); |
212 FillMatchingLogins(form, prompt_policy)); | |
213 if (matched_forms.empty() && db_handler_) { | 211 if (matched_forms.empty() && db_handler_) { |
214 db_handler_->GetIE7Login( | 212 db_handler_->GetIE7Login( |
215 form, base::Bind(&GetLoginsRequest::NotifyConsumerWithResults, | 213 form, base::Bind(&GetLoginsRequest::NotifyConsumerWithResults, |
216 base::Owned(request.release()))); | 214 base::Owned(request.release()))); |
217 } else { | 215 } else { |
218 request->NotifyConsumerWithResults(matched_forms.Pass()); | 216 request->NotifyConsumerWithResults(matched_forms.Pass()); |
219 } | 217 } |
220 } | 218 } |
OLD | NEW |