OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
8 | 8 |
| 9 #include "base/bind.h" |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/password_manager/ie7_password.h" | 13 #include "chrome/browser/password_manager/ie7_password.h" |
13 #include "chrome/browser/password_manager/password_manager.h" | 14 #include "chrome/browser/password_manager/password_manager.h" |
14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/webdata/web_data_service.h" | 16 #include "chrome/browser/webdata/web_data_service.h" |
16 | 17 |
17 using content::BrowserThread; | 18 using content::BrowserThread; |
18 using webkit_glue::PasswordForm; | 19 using webkit_glue::PasswordForm; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 181 } |
181 | 182 |
182 PasswordStore::GetLoginsRequest* PasswordStoreWin::NewGetLoginsRequest( | 183 PasswordStore::GetLoginsRequest* PasswordStoreWin::NewGetLoginsRequest( |
183 GetLoginsCallback* callback) { | 184 GetLoginsCallback* callback) { |
184 return new FormGetLoginsRequest(callback); | 185 return new FormGetLoginsRequest(callback); |
185 } | 186 } |
186 | 187 |
187 void PasswordStoreWin::Shutdown() { | 188 void PasswordStoreWin::Shutdown() { |
188 BrowserThread::PostTask( | 189 BrowserThread::PostTask( |
189 BrowserThread::DB, FROM_HERE, | 190 BrowserThread::DB, FROM_HERE, |
190 NewRunnableMethod(this, &PasswordStoreWin::ShutdownOnDBThread)); | 191 base::Bind(&PasswordStoreWin::ShutdownOnDBThread, this)); |
191 PasswordStoreDefault::Shutdown(); | 192 PasswordStoreDefault::Shutdown(); |
192 } | 193 } |
193 | 194 |
194 void PasswordStoreWin::ForwardLoginsResult(GetLoginsRequest* request) { | 195 void PasswordStoreWin::ForwardLoginsResult(GetLoginsRequest* request) { |
195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 196 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
196 if (static_cast<FormGetLoginsRequest*>(request)->IsLoginsRequest() && | 197 if (static_cast<FormGetLoginsRequest*>(request)->IsLoginsRequest() && |
197 request->value.empty() && db_handler_.get()) { | 198 request->value.empty() && db_handler_.get()) { |
198 db_handler_->GetIE7Login( | 199 db_handler_->GetIE7Login( |
199 static_cast<FormGetLoginsRequest*>(request)->form()->origin, | 200 static_cast<FormGetLoginsRequest*>(request)->form()->origin, |
200 request); | 201 request); |
201 } else { | 202 } else { |
202 PasswordStore::ForwardLoginsResult(request); | 203 PasswordStore::ForwardLoginsResult(request); |
203 } | 204 } |
204 } | 205 } |
205 | 206 |
206 void PasswordStoreWin::GetLoginsImpl(GetLoginsRequest* request, | 207 void PasswordStoreWin::GetLoginsImpl(GetLoginsRequest* request, |
207 const PasswordForm& form) { | 208 const PasswordForm& form) { |
208 static_cast<FormGetLoginsRequest*>(request)->SetLoginsRequestForm(form); | 209 static_cast<FormGetLoginsRequest*>(request)->SetLoginsRequestForm(form); |
209 | 210 |
210 PasswordStoreDefault::GetLoginsImpl(request, form); | 211 PasswordStoreDefault::GetLoginsImpl(request, form); |
211 } | 212 } |
OLD | NEW |