Chromium Code Reviews| Index: chrome/browser/password_manager/chrome_password_manager_client.h |
| diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h |
| index 203aa420236567ee9de27022a887f25fb8bbf99a..74bade548a57702bc20fedfd3ccf943f9b9bd0a6 100644 |
| --- a/chrome/browser/password_manager/chrome_password_manager_client.h |
| +++ b/chrome/browser/password_manager/chrome_password_manager_client.h |
| @@ -7,6 +7,7 @@ |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| +#include "base/gtest_prod_util.h" |
| #include "components/password_manager/content/browser/content_password_manager_driver.h" |
| #include "components/password_manager/core/browser/password_manager_client.h" |
| #include "content/public/browser/web_contents_observer.h" |
| @@ -40,6 +41,8 @@ class ChromePasswordManagerClient |
| // PasswordManagerClient implementation. |
| virtual bool IsAutomaticPasswordSavingEnabled() const OVERRIDE; |
| virtual bool IsPasswordManagerEnabledForCurrentPage() const OVERRIDE; |
| + virtual bool ShouldFilterAutofillResult( |
| + const autofill::PasswordForm& form) const OVERRIDE; |
| virtual bool IsSyncAccountCredential( |
| const std::string& username, const std::string& origin) const OVERRIDE; |
| virtual void PromptUserToSavePassword( |
| @@ -91,9 +94,17 @@ class ChromePasswordManagerClient |
| static bool EnabledForSyncSignin(); |
| private: |
| + enum AutofillForSyncCredentialsState { |
| + ALLOW_SYNC_CREDENTIALS, |
| + DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH, |
| + DISALLOW_SYNC_CREDENTIALS, |
| + }; |
| + |
| ChromePasswordManagerClient(content::WebContents* web_contents, |
| autofill::AutofillClient* autofill_client); |
| friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
| + FRIEND_TEST_ALL_PREFIXES(ChromePasswordManagerClientTest, |
| + LastLoadWasTransactionalReauthPage); |
|
Ilya Sherman
2014/08/12 02:17:32
Can you test the public API, rather than testing a
Garrett Casto
2014/08/13 20:34:40
Done.
|
| // content::WebContentsObserver overrides. |
| virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| @@ -122,6 +133,13 @@ class ChromePasswordManagerClient |
| // |can_use_log_router_|. |
| void NotifyRendererOfLoggingAvailability(); |
| + // Returns true if the last loaded page was for transactional re-auth on a |
| + // Google property. |
| + bool LastLoadWasTransactionalReauthPage() const; |
| + |
| + // Sets |autofill_state_| based on experiment and flag values. |
| + void SetupAutofillSyncState(); |
|
Ilya Sherman
2014/08/12 02:17:32
nit: "Setup" -> "SetUp". "setup" is a noun; "set
Garrett Casto
2014/08/13 20:34:40
Done.
|
| + |
| Profile* const profile_; |
| password_manager::ContentPasswordManagerDriver driver_; |
| @@ -139,6 +157,8 @@ class ChromePasswordManagerClient |
| // True if |this| is registered with some LogRouter which can accept logs. |
| bool can_use_log_router_; |
| + AutofillForSyncCredentialsState autofill_state_; |
|
Ilya Sherman
2014/08/12 02:17:33
nit: Please document this variable. Also, "autofi
Garrett Casto
2014/08/13 20:34:40
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
| }; |