| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 24 | 24 |
| 25 using password_manager::PasswordStore; | 25 using password_manager::PasswordStore; |
| 26 | 26 |
| 27 PasswordManagerPresenter::PasswordManagerPresenter( | 27 PasswordManagerPresenter::PasswordManagerPresenter( |
| 28 PasswordUIView* password_view) | 28 PasswordUIView* password_view) |
| 29 : populater_(this), | 29 : populater_(this), |
| 30 exception_populater_(this), | 30 exception_populater_(this), |
| 31 password_view_(password_view) { | 31 password_view_(password_view) { |
| 32 DCHECK(password_view_); | 32 DCHECK(password_view_); |
| 33 require_reauthentication_ = !CommandLine::ForCurrentProcess()->HasSwitch( | 33 require_reauthentication_ = |
| 34 switches::kDisablePasswordManagerReauthentication); | 34 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 35 switches::kDisablePasswordManagerReauthentication); |
| 35 } | 36 } |
| 36 | 37 |
| 37 PasswordManagerPresenter::~PasswordManagerPresenter() { | 38 PasswordManagerPresenter::~PasswordManagerPresenter() { |
| 38 PasswordStore* store = GetPasswordStore(); | 39 PasswordStore* store = GetPasswordStore(); |
| 39 if (store) | 40 if (store) |
| 40 store->RemoveObserver(this); | 41 store->RemoveObserver(this); |
| 41 } | 42 } |
| 42 | 43 |
| 43 void PasswordManagerPresenter::Initialize() { | 44 void PasswordManagerPresenter::Initialize() { |
| 44 // Due to the way that handlers are (re)initialized under certain types of | 45 // Due to the way that handlers are (re)initialized under certain types of |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 233 } |
| 233 | 234 |
| 234 void PasswordManagerPresenter::PasswordExceptionListPopulater:: | 235 void PasswordManagerPresenter::PasswordExceptionListPopulater:: |
| 235 OnGetPasswordStoreResults( | 236 OnGetPasswordStoreResults( |
| 236 const std::vector<autofill::PasswordForm*>& results) { | 237 const std::vector<autofill::PasswordForm*>& results) { |
| 237 page_->password_exception_list_.clear(); | 238 page_->password_exception_list_.clear(); |
| 238 page_->password_exception_list_.insert(page_->password_exception_list_.end(), | 239 page_->password_exception_list_.insert(page_->password_exception_list_.end(), |
| 239 results.begin(), results.end()); | 240 results.begin(), results.end()); |
| 240 page_->SetPasswordExceptionList(); | 241 page_->SetPasswordExceptionList(); |
| 241 } | 242 } |
| OLD | NEW |