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" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/password_manager/password_manager_util.h" | 14 #include "chrome/browser/password_manager/password_manager_util.h" |
15 #include "chrome/browser/password_manager/password_store_factory.h" | 15 #include "chrome/browser/password_manager/password_store_factory.h" |
16 #include "chrome/browser/password_manager/sync_metrics.h" | 16 #include "chrome/browser/password_manager/sync_metrics.h" |
| 17 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ui/passwords/password_ui_view.h" | 18 #include "chrome/browser/ui/passwords/password_ui_view.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
20 #include "components/autofill/core/common/password_form.h" | 21 #include "components/autofill/core/common/password_form.h" |
21 #include "components/password_manager/core/common/password_manager_pref_names.h" | 22 #include "components/password_manager/core/common/password_manager_pref_names.h" |
22 #include "content/public/browser/user_metrics.h" | 23 #include "content/public/browser/user_metrics.h" |
23 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
24 | 25 |
25 using password_manager::PasswordStore; | 26 using password_manager::PasswordStore; |
26 | 27 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 63 } |
63 | 64 |
64 void PasswordManagerPresenter::OnLoginsChanged( | 65 void PasswordManagerPresenter::OnLoginsChanged( |
65 const password_manager::PasswordStoreChangeList& changes) { | 66 const password_manager::PasswordStoreChangeList& changes) { |
66 // Entire list is updated for convenience. | 67 // Entire list is updated for convenience. |
67 UpdatePasswordLists(); | 68 UpdatePasswordLists(); |
68 } | 69 } |
69 | 70 |
70 PasswordStore* PasswordManagerPresenter::GetPasswordStore() { | 71 PasswordStore* PasswordManagerPresenter::GetPasswordStore() { |
71 return PasswordStoreFactory::GetForProfile(password_view_->GetProfile(), | 72 return PasswordStoreFactory::GetForProfile(password_view_->GetProfile(), |
72 Profile::EXPLICIT_ACCESS).get(); | 73 ServiceAccessType::EXPLICIT_ACCESS) |
| 74 .get(); |
73 } | 75 } |
74 | 76 |
75 void PasswordManagerPresenter::UpdatePasswordLists() { | 77 void PasswordManagerPresenter::UpdatePasswordLists() { |
76 // Reset so that showing a password will require re-authentication. | 78 // Reset so that showing a password will require re-authentication. |
77 last_authentication_time_ = base::TimeTicks(); | 79 last_authentication_time_ = base::TimeTicks(); |
78 | 80 |
79 // Reset the current lists. | 81 // Reset the current lists. |
80 password_list_.clear(); | 82 password_list_.clear(); |
81 password_exception_list_.clear(); | 83 password_exception_list_.clear(); |
82 | 84 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 235 } |
234 | 236 |
235 void PasswordManagerPresenter::PasswordExceptionListPopulater:: | 237 void PasswordManagerPresenter::PasswordExceptionListPopulater:: |
236 OnGetPasswordStoreResults( | 238 OnGetPasswordStoreResults( |
237 const std::vector<autofill::PasswordForm*>& results) { | 239 const std::vector<autofill::PasswordForm*>& results) { |
238 page_->password_exception_list_.clear(); | 240 page_->password_exception_list_.clear(); |
239 page_->password_exception_list_.insert(page_->password_exception_list_.end(), | 241 page_->password_exception_list_.insert(page_->password_exception_list_.end(), |
240 results.begin(), results.end()); | 242 results.begin(), results.end()); |
241 page_->SetPasswordExceptionList(); | 243 page_->SetPasswordExceptionList(); |
242 } | 244 } |
OLD | NEW |