| 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 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 10 #include "components/password_manager/core/common/password_manager_ui.h" | 10 #include "components/password_manager/core/common/password_manager_ui.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 return navigated_to_settings_page_; | 33 return navigated_to_settings_page_; |
| 34 } | 34 } |
| 35 | 35 |
| 36 // We don't have a FormManager in tests, so stub these out. | 36 // We don't have a FormManager in tests, so stub these out. |
| 37 void SavePasswordInternal() override; | 37 void SavePasswordInternal() override; |
| 38 bool saved_password() const { return saved_password_; } | 38 bool saved_password() const { return saved_password_; } |
| 39 | 39 |
| 40 void NeverSavePasswordInternal() override; | 40 void NeverSavePasswordInternal() override; |
| 41 bool never_saved_password() const { return never_saved_password_; } | 41 bool never_saved_password() const { return never_saved_password_; } |
| 42 | 42 |
| 43 const autofill::PasswordForm& PendingCredentials() const override; | 43 void ChooseCredential(bool was_chosen, |
| 44 void SetPendingCredentials(autofill::PasswordForm pending_credentials); | 44 const autofill::PasswordForm& form) override; |
| 45 bool choose_credential() const { return choose_credential_; } |
| 46 |
| 47 const autofill::PasswordForm& PendingPassword() const override; |
| 48 void SetPendingPassword(autofill::PasswordForm pending_password); |
| 49 |
| 50 void UpdateBubbleAndIconVisibility() override; |
| 45 | 51 |
| 46 // Sneaky setters for testing. | 52 // Sneaky setters for testing. |
| 47 void SetPasswordFormMap(const autofill::ConstPasswordFormMap& map) { | 53 void SetPasswordFormMap(const autofill::ConstPasswordFormMap& map) { |
| 48 password_form_map_ = map; | 54 password_form_map_ = map; |
| 49 } | 55 } |
| 50 void SetState(password_manager::ui::State state) { state_ = state; } | 56 void SetState(password_manager::ui::State state) { state_ = state; } |
| 51 | 57 |
| 52 void SetTimer(base::ElapsedTimer* timer) { timer_.reset(timer); } | 58 void SetTimer(base::ElapsedTimer* timer) { timer_.reset(timer); } |
| 53 | 59 |
| 54 // True if this controller is installed on |web_contents()|. | 60 // True if this controller is installed on |web_contents()|. |
| 55 bool IsInstalled() const; | 61 bool IsInstalled() const; |
| 56 | 62 |
| 57 using ManagePasswordsUIController::DidNavigateMainFrame; | 63 using ManagePasswordsUIController::DidNavigateMainFrame; |
| 58 | 64 |
| 59 private: | 65 private: |
| 60 bool navigated_to_settings_page_; | 66 bool navigated_to_settings_page_; |
| 61 bool saved_password_; | 67 bool saved_password_; |
| 62 bool never_saved_password_; | 68 bool never_saved_password_; |
| 69 bool choose_credential_; |
| 63 | 70 |
| 64 autofill::PasswordForm pending_credentials_; | 71 autofill::PasswordForm pending_password_; |
| 65 | 72 |
| 66 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIControllerMock); | 73 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIControllerMock); |
| 67 }; | 74 }; |
| 68 | 75 |
| 69 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ | 76 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ |
| OLD | NEW |