| 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_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "components/password_manager/content/browser/content_password_manager_d
river.h" | 10 #include "components/password_manager/content/browser/content_password_manager_d
river.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // ChromePasswordManagerClient implements the PasswordManagerClient interface. | 32 // ChromePasswordManagerClient implements the PasswordManagerClient interface. |
| 33 class ChromePasswordManagerClient | 33 class ChromePasswordManagerClient |
| 34 : public password_manager::PasswordManagerClient, | 34 : public password_manager::PasswordManagerClient, |
| 35 public content::WebContentsObserver, | 35 public content::WebContentsObserver, |
| 36 public content::WebContentsUserData<ChromePasswordManagerClient> { | 36 public content::WebContentsUserData<ChromePasswordManagerClient> { |
| 37 public: | 37 public: |
| 38 virtual ~ChromePasswordManagerClient(); | 38 virtual ~ChromePasswordManagerClient(); |
| 39 | 39 |
| 40 // PasswordManagerClient implementation. | 40 // PasswordManagerClient implementation. |
| 41 virtual bool IsAutomaticPasswordSavingEnabled() const OVERRIDE; | 41 virtual bool IsAutomaticPasswordSavingEnabled() const OVERRIDE; |
| 42 virtual bool IsPasswordManagerEnabledForCurrentPage() const OVERRIDE; |
| 42 virtual void PromptUserToSavePassword( | 43 virtual void PromptUserToSavePassword( |
| 43 password_manager::PasswordFormManager* form_to_save) OVERRIDE; | 44 password_manager::PasswordFormManager* form_to_save) OVERRIDE; |
| 44 virtual void PasswordWasAutofilled( | 45 virtual void PasswordWasAutofilled( |
| 45 const autofill::PasswordFormMap& best_matches) const OVERRIDE; | 46 const autofill::PasswordFormMap& best_matches) const OVERRIDE; |
| 46 virtual void PasswordAutofillWasBlocked( | 47 virtual void PasswordAutofillWasBlocked( |
| 47 const autofill::PasswordFormMap& best_matches) const OVERRIDE; | 48 const autofill::PasswordFormMap& best_matches) const OVERRIDE; |
| 48 virtual void AuthenticateAutofillAndFillForm( | 49 virtual void AuthenticateAutofillAndFillForm( |
| 49 scoped_ptr<autofill::PasswordFormFillData> fill_data) OVERRIDE; | 50 scoped_ptr<autofill::PasswordFormFillData> fill_data) OVERRIDE; |
| 50 virtual PrefService* GetPrefs() OVERRIDE; | 51 virtual PrefService* GetPrefs() OVERRIDE; |
| 51 virtual password_manager::PasswordStore* GetPasswordStore() OVERRIDE; | 52 virtual password_manager::PasswordStore* GetPasswordStore() OVERRIDE; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 74 static password_manager::PasswordGenerationManager* | 75 static password_manager::PasswordGenerationManager* |
| 75 GetGenerationManagerFromWebContents(content::WebContents* contents); | 76 GetGenerationManagerFromWebContents(content::WebContents* contents); |
| 76 | 77 |
| 77 // Observer for PasswordGenerationPopup events. Used for testing. | 78 // Observer for PasswordGenerationPopup events. Used for testing. |
| 78 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); | 79 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); |
| 79 | 80 |
| 80 // Returns true if the bubble UI is enabled, and false if we're still using | 81 // Returns true if the bubble UI is enabled, and false if we're still using |
| 81 // the sad old Infobar UI. | 82 // the sad old Infobar UI. |
| 82 static bool IsTheHotNewBubbleUIEnabled(); | 83 static bool IsTheHotNewBubbleUIEnabled(); |
| 83 | 84 |
| 85 // Returns true if the password manager should be enabled during sync signin. |
| 86 static bool EnabledForSyncSignin(); |
| 87 |
| 84 private: | 88 private: |
| 85 ChromePasswordManagerClient(content::WebContents* web_contents, | 89 ChromePasswordManagerClient(content::WebContents* web_contents, |
| 86 autofill::AutofillClient* autofill_client); | 90 autofill::AutofillClient* autofill_client); |
| 87 friend class content::WebContentsUserData<ChromePasswordManagerClient>; | 91 friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
| 88 | 92 |
| 89 // content::WebContentsObserver overrides. | 93 // content::WebContentsObserver overrides. |
| 90 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 94 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 91 | 95 |
| 92 // Callback method to be triggered when authentication is successful for a | 96 // Callback method to be triggered when authentication is successful for a |
| 93 // given password authentication request. If authentication is disabled or | 97 // given password authentication request. If authentication is disabled or |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Allows authentication callbacks to be destroyed when this client is gone. | 131 // Allows authentication callbacks to be destroyed when this client is gone. |
| 128 base::WeakPtrFactory<ChromePasswordManagerClient> weak_factory_; | 132 base::WeakPtrFactory<ChromePasswordManagerClient> weak_factory_; |
| 129 | 133 |
| 130 // True if |this| is registered with some LogRouter which can accept logs. | 134 // True if |this| is registered with some LogRouter which can accept logs. |
| 131 bool can_use_log_router_; | 135 bool can_use_log_router_; |
| 132 | 136 |
| 133 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 137 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
| 134 }; | 138 }; |
| 135 | 139 |
| 136 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 140 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| OLD | NEW |