Chromium Code Reviews| Index: chrome/browser/password_manager/save_password_infobar_delegate.h |
| diff --git a/chrome/browser/password_manager/save_password_infobar_delegate.h b/chrome/browser/password_manager/save_password_infobar_delegate.h |
| index fdf3e35b68e7b70cf55a2e62aa871e80007315de..596cc0cffdaa92c4adb4b47e1ef23ef51af174a3 100644 |
| --- a/chrome/browser/password_manager/save_password_infobar_delegate.h |
| +++ b/chrome/browser/password_manager/save_password_infobar_delegate.h |
| @@ -6,11 +6,9 @@ |
| #define CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
| #include "base/basictypes.h" |
| -#include "base/compiler_specific.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/timer/elapsed_timer.h" |
| #include "components/infobars/core/confirm_infobar_delegate.h" |
| -#include "components/infobars/core/infobar_delegate.h" |
| #include "components/password_manager/core/browser/password_form_manager.h" |
| #include "components/password_manager/core/browser/password_manager_metrics_util.h" |
| @@ -18,6 +16,10 @@ namespace content { |
| class WebContents; |
| } |
| +namespace password_manager { |
| +enum class CredentialSourceType; |
| +} |
| + |
| // After a successful *new* login attempt, we take the PasswordFormManager in |
| // provisional_save_manager_ and move it to a SavePasswordInfoBarDelegate while |
| // the user makes up their mind with the "save password" infobar. Note if the |
| @@ -35,15 +37,16 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { |
| static void Create( |
| content::WebContents* web_contents, |
| scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
| - const std::string& uma_histogram_suffix); |
| - |
| - private: |
| - SavePasswordInfoBarDelegate( |
| - scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
| - const std::string& uma_histogram_suffix); |
| + const std::string& uma_histogram_suffix, |
| + password_manager::CredentialSourceType source_type); |
| ~SavePasswordInfoBarDelegate() override; |
| + // If the infobar was triggered by the Credential management API, then on |
| + // Android |
| + // it should display the "More" button. |
|
Bernhard Bauer
2015/03/03 16:54:20
Merge this with the previous line.
melandory
2015/03/05 17:15:12
Done.
|
| + bool ShouldShowMoreButton(); |
| + |
| // ConfirmInfoBarDelegate: |
| Type GetInfoBarType() const override; |
| InfoBarAutomationType GetInfoBarAutomationType() const override; |
| @@ -55,6 +58,12 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { |
| bool Accept() override; |
| bool Cancel() override; |
| + private: |
| + SavePasswordInfoBarDelegate( |
| + scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
| + const std::string& uma_histogram_suffix, |
| + password_manager::CredentialSourceType source_type); |
| + |
| // The PasswordFormManager managing the form we're asking the user about, |
| // and should update as per her decision. |
| scoped_ptr<password_manager::PasswordFormManager> form_to_save_; |
| @@ -70,6 +79,10 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { |
| // form is on a monitored domain. Otherwise, an empty string. |
| const std::string uma_histogram_suffix_; |
| + // Records source from where infobar was triggered. |
| + // Infobar appearance (title, buttons) depends on value of this parameter. |
| + password_manager::CredentialSourceType source_type_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); |
| }; |