Chromium Code Reviews| Index: chrome/browser/password_manager/password_manager_test_base.h |
| diff --git a/chrome/browser/password_manager/password_manager_test_base.h b/chrome/browser/password_manager/password_manager_test_base.h |
| index 44ce40bca940afb315b2cf4961b4295582c0cced..6b97ba51d0b5af07c7773431ce486eff558f198d 100644 |
| --- a/chrome/browser/password_manager/password_manager_test_base.h |
| +++ b/chrome/browser/password_manager/password_manager_test_base.h |
| @@ -11,6 +11,10 @@ |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/test/test_utils.h" |
| +namespace autofill { |
| +struct PasswordForm; |
| +} |
| + |
| class NavigationObserver : public content::WebContentsObserver { |
| public: |
| explicit NavigationObserver(content::WebContents* web_contents); |
| @@ -55,13 +59,20 @@ class PromptObserver { |
| public: |
| virtual ~PromptObserver(); |
| - // Checks if the prompt is being currently shown. |
| + // Checks if the save prompt is being currently shown. |
| virtual bool IsShowingPrompt() const = 0; |
| + // Checks if the update prompt is being currently shown. |
| + virtual bool IsShowingUpdatePrompt() const; |
| + |
| // Expecting that the prompt is shown, saves the password. Checks that the |
| // prompt is no longer visible afterwards. |
| void Accept() const; |
| + // Expecting that the prompt is shown, update |form| with the password from |
| + // observed form. Checks that the prompt is no longer visible afterwards. |
| + void AcceptUpdatePrompt(const autofill::PasswordForm& form) const; |
| + |
| // Chooses the right implementation of PromptObserver and creates an instance |
| // of it. |
| static scoped_ptr<PromptObserver> Create(content::WebContents* web_contents); |
| @@ -74,6 +85,12 @@ class PromptObserver { |
| // closed. |
| virtual void AcceptImpl() const = 0; |
| + // Accepts the password update. The implementation can assume that the prompt |
| + // is currently shown, but is required to verify that the prompt is eventually |
| + // closed. |
| + virtual void AcceptUpdatePromptImpl( |
| + const autofill::PasswordForm& form) const {} |
|
vabr (Chromium)
2015/08/04 08:59:07
Please insert a TODO comment noting that this shou
dvadym
2015/08/04 14:34:46
Done.
|
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(PromptObserver); |
| }; |