| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/passwords/password_manager_presenter.h" | 5 #include "chrome/browser/ui/passwords/password_manager_presenter.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/metrics/user_metrics_action.h" | 11 #include "base/metrics/user_metrics_action.h" |
| 10 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 13 #include "base/values.h" | 15 #include "base/values.h" |
| 14 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 15 #include "chrome/browser/password_manager/password_store_factory.h" | 17 #include "chrome/browser/password_manager/password_store_factory.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 cancelable_task_tracker()->TryCancelAll(); | 238 cancelable_task_tracker()->TryCancelAll(); |
| 237 store->GetAutofillableLogins(this); | 239 store->GetAutofillableLogins(this); |
| 238 } else { | 240 } else { |
| 239 LOG(ERROR) << "No password store! Cannot display passwords."; | 241 LOG(ERROR) << "No password store! Cannot display passwords."; |
| 240 } | 242 } |
| 241 } | 243 } |
| 242 | 244 |
| 243 void PasswordManagerPresenter::PasswordListPopulater::OnGetPasswordStoreResults( | 245 void PasswordManagerPresenter::PasswordListPopulater::OnGetPasswordStoreResults( |
| 244 ScopedVector<autofill::PasswordForm> results) { | 246 ScopedVector<autofill::PasswordForm> results) { |
| 245 page_->password_list_ = | 247 page_->password_list_ = |
| 246 password_manager_util::ConvertScopedVector(results.Pass()); | 248 password_manager_util::ConvertScopedVector(std::move(results)); |
| 247 page_->SetPasswordList(); | 249 page_->SetPasswordList(); |
| 248 } | 250 } |
| 249 | 251 |
| 250 PasswordManagerPresenter::PasswordExceptionListPopulater:: | 252 PasswordManagerPresenter::PasswordExceptionListPopulater:: |
| 251 PasswordExceptionListPopulater(PasswordManagerPresenter* page) | 253 PasswordExceptionListPopulater(PasswordManagerPresenter* page) |
| 252 : ListPopulater(page) { | 254 : ListPopulater(page) { |
| 253 } | 255 } |
| 254 | 256 |
| 255 void PasswordManagerPresenter::PasswordExceptionListPopulater::Populate() { | 257 void PasswordManagerPresenter::PasswordExceptionListPopulater::Populate() { |
| 256 PasswordStore* store = page_->GetPasswordStore(); | 258 PasswordStore* store = page_->GetPasswordStore(); |
| 257 if (store != NULL) { | 259 if (store != NULL) { |
| 258 cancelable_task_tracker()->TryCancelAll(); | 260 cancelable_task_tracker()->TryCancelAll(); |
| 259 store->GetBlacklistLogins(this); | 261 store->GetBlacklistLogins(this); |
| 260 } else { | 262 } else { |
| 261 LOG(ERROR) << "No password store! Cannot display exceptions."; | 263 LOG(ERROR) << "No password store! Cannot display exceptions."; |
| 262 } | 264 } |
| 263 } | 265 } |
| 264 | 266 |
| 265 void PasswordManagerPresenter::PasswordExceptionListPopulater:: | 267 void PasswordManagerPresenter::PasswordExceptionListPopulater:: |
| 266 OnGetPasswordStoreResults(ScopedVector<autofill::PasswordForm> results) { | 268 OnGetPasswordStoreResults(ScopedVector<autofill::PasswordForm> results) { |
| 267 page_->password_exception_list_ = | 269 page_->password_exception_list_ = |
| 268 password_manager_util::ConvertScopedVector(results.Pass()); | 270 password_manager_util::ConvertScopedVector(std::move(results)); |
| 269 page_->SetPasswordExceptionList(); | 271 page_->SetPasswordExceptionList(); |
| 270 } | 272 } |
| OLD | NEW |