| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/manage_passwords_ui_controller_mock.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" |
| 6 | 6 |
| 7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
| 8 | 8 |
| 9 ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock( | 9 ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock( |
| 10 content::WebContents* contents) | 10 content::WebContents* contents) |
| 11 : ManagePasswordsUIController(contents), | 11 : ManagePasswordsUIController(contents), |
| 12 navigated_to_settings_page_(false), | 12 navigated_to_settings_page_(false), |
| 13 navigated_to_account_central_management_page_(false), | |
| 14 saved_password_(false), | 13 saved_password_(false), |
| 15 never_saved_password_(false) { | 14 never_saved_password_(false) { |
| 16 contents->SetUserData(UserDataKey(), this); | 15 contents->SetUserData(UserDataKey(), this); |
| 17 } | 16 } |
| 18 | 17 |
| 19 ManagePasswordsUIControllerMock:: | 18 ManagePasswordsUIControllerMock:: |
| 20 ~ManagePasswordsUIControllerMock() {} | 19 ~ManagePasswordsUIControllerMock() {} |
| 21 | 20 |
| 22 void ManagePasswordsUIControllerMock:: | 21 void ManagePasswordsUIControllerMock:: |
| 23 NavigateToPasswordManagerSettingsPage() { | 22 NavigateToPasswordManagerSettingsPage() { |
| 24 navigated_to_settings_page_ = true; | 23 navigated_to_settings_page_ = true; |
| 25 } | 24 } |
| 26 | 25 |
| 27 void ManagePasswordsUIControllerMock::NavigateToAccountCentralManagementPage() { | |
| 28 navigated_to_account_central_management_page_ = true; | |
| 29 } | |
| 30 | |
| 31 const autofill::PasswordForm& | 26 const autofill::PasswordForm& |
| 32 ManagePasswordsUIControllerMock::PendingCredentials() const { | 27 ManagePasswordsUIControllerMock::PendingCredentials() const { |
| 33 return pending_credentials_; | 28 return pending_credentials_; |
| 34 } | 29 } |
| 35 | 30 |
| 36 void ManagePasswordsUIControllerMock::SetPendingCredentials( | 31 void ManagePasswordsUIControllerMock::SetPendingCredentials( |
| 37 autofill::PasswordForm pending_credentials) { | 32 autofill::PasswordForm pending_credentials) { |
| 38 pending_credentials_ = pending_credentials; | 33 pending_credentials_ = pending_credentials; |
| 39 } | 34 } |
| 40 | 35 |
| 41 bool ManagePasswordsUIControllerMock::IsInstalled() const { | 36 bool ManagePasswordsUIControllerMock::IsInstalled() const { |
| 42 return web_contents()->GetUserData(UserDataKey()) == this; | 37 return web_contents()->GetUserData(UserDataKey()) == this; |
| 43 } | 38 } |
| 44 | 39 |
| 45 void ManagePasswordsUIControllerMock::SavePasswordInternal() { | 40 void ManagePasswordsUIControllerMock::SavePasswordInternal() { |
| 46 saved_password_ = true; | 41 saved_password_ = true; |
| 47 } | 42 } |
| 48 | 43 |
| 49 void ManagePasswordsUIControllerMock::NeverSavePasswordInternal() { | 44 void ManagePasswordsUIControllerMock::NeverSavePasswordInternal() { |
| 50 never_saved_password_ = true; | 45 never_saved_password_ = true; |
| 51 } | 46 } |
| OLD | NEW |