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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h"
7 #include "content/public/browser/web_contents.h"
9 ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock(
10 content::WebContents* contents)
11 : ManagePasswordsUIController(contents),
12 navigated_to_settings_page_(false),
13 saved_password_(false),
14 never_saved_password_(false) {
15 contents->SetUserData(UserDataKey(), this);
18 ManagePasswordsUIControllerMock::
19 ~ManagePasswordsUIControllerMock() {}
21 void ManagePasswordsUIControllerMock::
22 NavigateToPasswordManagerSettingsPage() {
23 navigated_to_settings_page_ = true;
26 const autofill::PasswordForm&
27 ManagePasswordsUIControllerMock::PendingCredentials() const {
28 return pending_credentials_;
31 bool ManagePasswordsUIControllerMock::IsInstalled() const {
32 return web_contents()->GetUserData(UserDataKey()) == this;
35 void ManagePasswordsUIControllerMock::SavePassword() {
36 saved_password_ = true;
39 void ManagePasswordsUIControllerMock::NeverSavePassword() {
40 never_saved_password_ = true;