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 c4a0e2a20a6e16319da6e1a9feade05fbe000698..aae77d5a4785e300b89a9987cfb6735c05d67ae5 100644 |
| --- a/chrome/browser/password_manager/chrome_password_manager_client.h |
| +++ b/chrome/browser/password_manager/chrome_password_manager_client.h |
| @@ -11,12 +11,14 @@ |
| #include "base/compiler_specific.h" |
| #include "base/macros.h" |
| #include "base/memory/scoped_vector.h" |
| +#include "components/autofill/content/public/interfaces/autofill_driver.mojom.h" |
| #include "components/password_manager/content/browser/content_password_manager_driver_factory.h" |
| #include "components/password_manager/content/browser/credential_manager_impl.h" |
| #include "components/password_manager/core/browser/password_manager.h" |
| #include "components/password_manager/core/browser/password_manager_client.h" |
| #include "components/password_manager/sync/browser/sync_credentials_filter.h" |
| #include "components/prefs/pref_member.h" |
| +#include "content/public/browser/web_contents_binding_set.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/browser/web_contents_user_data.h" |
| #include "ui/gfx/geometry/rect.h" |
| @@ -42,7 +44,8 @@ class PasswordManagerDriver; |
| class ChromePasswordManagerClient |
| : public password_manager::PasswordManagerClient, |
| public content::WebContentsObserver, |
| - public content::WebContentsUserData<ChromePasswordManagerClient> { |
| + public content::WebContentsUserData<ChromePasswordManagerClient>, |
| + public autofill::mojom::PasswordManagerClient { |
| public: |
| ~ChromePasswordManagerClient() override; |
| @@ -94,8 +97,26 @@ class ChromePasswordManagerClient |
| const override; |
| const password_manager::LogManager* GetLogManager() const override; |
| + // autofill::mojom::PasswordManagerClient overrides. |
| + // Causes the password generation UI to be shown for the specified form. |
|
vabr (Chromium)
2016/09/27 15:06:11
nit: Please move these comments to interface Passw
leonhsl(Using Gerrit)
2016/09/28 02:40:39
Done. Moved these comments to interface definition
|
| + // The popup will be anchored at |bounds|. The generated password |
| + // will be no longer than |max_length|. |generation_element| should contain a |
| + // name of a password field at which generation popup is attached. |
| + // |is_manually_triggered| informs whether it is automatically or manually |
| + // triggered generation. |
| + void ShowPasswordGenerationPopup(const gfx::RectF& bounds, |
| + int max_length, |
| + const base::string16& generation_element, |
| + bool is_manually_triggered, |
| + const autofill::PasswordForm& form) override; |
| + // Causes the password editing UI to be shown anchored at |bounds|. |
| + void ShowPasswordEditingPopup(const gfx::RectF& bounds, |
| + const autofill::PasswordForm& form) override; |
| + // Notify the PasswordManager that generation is available for |form|. Used |
| + // for UMA stats. |
| + void GenerationAvailableForForm(const autofill::PasswordForm& form) override; |
| // Hides any visible generation UI. |
| - void HidePasswordGenerationPopup(); |
| + void HidePasswordGenerationPopup() override; |
| static void CreateForWebContentsWithAutofillClient( |
| content::WebContents* contents, |
| @@ -117,8 +138,6 @@ class ChromePasswordManagerClient |
| friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
| // content::WebContentsObserver overrides. |
| - bool OnMessageReceived(const IPC::Message& message, |
| - content::RenderFrameHost* render_frame_host) override; |
| void DidStartNavigation( |
| content::NavigationHandle* navigation_handle) override; |
| @@ -131,33 +150,11 @@ class ChromePasswordManagerClient |
| // filled. |
| bool IsPasswordManagementEnabledForCurrentPage() const; |
| - // Causes the password generation UI to be shown for the specified form. |
| - // The popup will be anchored at |element_bounds|. The generated password |
| - // will be no longer than |max_length|. |generation_element| should contain a |
| - // name of a password field at which generation popup is attached. |
| - // |is_manually_triggered| informs whether it is automatically or manually |
| - // triggered generation. |
| - void ShowPasswordGenerationPopup(content::RenderFrameHost* render_frame_host, |
| - const gfx::RectF& bounds, |
| - int max_length, |
| - const base::string16& generation_element, |
| - bool is_manually_triggered, |
| - const autofill::PasswordForm& form); |
| - |
| - // Causes the password editing UI to be shown anchored at |element_bounds|. |
| - void ShowPasswordEditingPopup(content::RenderFrameHost* render_frame_host, |
| - const gfx::RectF& bounds, |
| - const autofill::PasswordForm& form); |
| - |
| // Shows the dialog where the user can accept or decline the global autosignin |
| // setting as a first run experience. The dialog won't appear in Incognito or |
| // when the autosign-in is off. |
| void PromptUserToEnableAutosigninIfNecessary(); |
| - // Notify the PasswordManager that generation is available for |form|. Used |
| - // for UMA stats. |
| - void GenerationAvailableForForm(const autofill::PasswordForm& form); |
| - |
| // Called as a response to PromptUserToChooseCredentials. nullptr in |form| |
| // means that nothing was chosen. |one_local_credential| is true if there was |
| // just one local credential to be chosen from. |
| @@ -180,6 +177,9 @@ class ChromePasswordManagerClient |
| // once main frame host was created. |
| password_manager::CredentialManagerImpl credential_manager_impl_; |
| + content::WebContentsFrameBindingSet<autofill::mojom::PasswordManagerClient> |
| + password_manager_client_bindings_; |
| + |
| // Observer for password generation popup. |
| autofill::PasswordGenerationPopupObserver* observer_; |