| 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" |
| 11 #include "content/public/browser/navigation_details.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 class WebContents; | 14 class WebContents; |
| 14 } // namespace content | 15 } // namespace content |
| 15 | 16 |
| 16 // This mock is used in tests to ensure that we're just testing the controller | 17 // This mock is used in tests to ensure that we're just testing the controller |
| 17 // behavior, and not the behavior of the bits and pieces it relies upon (like | 18 // behavior, and not the behavior of the bits and pieces it relies upon (like |
| 18 // FormManager). | 19 // FormManager). |
| 19 class ManagePasswordsUIControllerMock | 20 class ManagePasswordsUIControllerMock |
| 20 : public ManagePasswordsUIController { | 21 : public ManagePasswordsUIController { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 40 bool never_saved_password() const { return never_saved_password_; } | 41 bool never_saved_password() const { return never_saved_password_; } |
| 41 | 42 |
| 42 virtual const autofill::PasswordForm& PendingCredentials() const OVERRIDE; | 43 virtual const autofill::PasswordForm& PendingCredentials() const OVERRIDE; |
| 43 | 44 |
| 44 // Sneaky setters for testing. | 45 // Sneaky setters for testing. |
| 45 void SetPasswordFormMap(const autofill::PasswordFormMap& map) { | 46 void SetPasswordFormMap(const autofill::PasswordFormMap& map) { |
| 46 password_form_map_ = map; | 47 password_form_map_ = map; |
| 47 } | 48 } |
| 48 void SetState(password_manager::ui::State state) { state_ = state; } | 49 void SetState(password_manager::ui::State state) { state_ = state; } |
| 49 | 50 |
| 51 void SetTimer(base::ElapsedTimer* timer) { timer_.reset(timer); } |
| 52 |
| 50 // True if this controller is installed on |web_contents()|. | 53 // True if this controller is installed on |web_contents()|. |
| 51 bool IsInstalled() const; | 54 bool IsInstalled() const; |
| 52 | 55 |
| 56 using ManagePasswordsUIController::DidNavigateMainFrame; |
| 57 |
| 53 private: | 58 private: |
| 54 bool navigated_to_settings_page_; | 59 bool navigated_to_settings_page_; |
| 55 bool saved_password_; | 60 bool saved_password_; |
| 56 bool never_saved_password_; | 61 bool never_saved_password_; |
| 57 | 62 |
| 58 autofill::PasswordForm pending_credentials_; | 63 autofill::PasswordForm pending_credentials_; |
| 59 | 64 |
| 60 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIControllerMock); | 65 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIControllerMock); |
| 61 }; | 66 }; |
| 62 | 67 |
| 63 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ | 68 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_MOCK_H_ |
| OLD | NEW |