Index: components/autofill/content/renderer/password_autofill_agent.h |
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h |
index 90b48fd11a5b596f9f69875b1e887ab03f8a3ddd..c417ed70378c330473a924536ccdc4dad3437798 100644 |
--- a/components/autofill/content/renderer/password_autofill_agent.h |
+++ b/components/autofill/content/renderer/password_autofill_agent.h |
@@ -10,6 +10,7 @@ |
#include <vector> |
#include "base/macros.h" |
+#include "components/autofill/content/public/interfaces/autofill_agent.mojom.h" |
#include "components/autofill/content/public/interfaces/autofill_driver.mojom.h" |
#include "components/autofill/content/renderer/autofill_agent.h" |
#include "components/autofill/content/renderer/password_form_conversion_utils.h" |
@@ -19,6 +20,7 @@ |
#include "components/autofill/core/common/password_form_fill_data.h" |
#include "content/public/renderer/render_frame_observer.h" |
#include "content/public/renderer/render_view_observer.h" |
+#include "mojo/public/cpp/bindings/binding.h" |
#include "third_party/WebKit/public/web/WebInputElement.h" |
namespace blink { |
@@ -32,13 +34,27 @@ namespace autofill { |
class RendererSavePasswordProgressLogger; |
// This class is responsible for filling password forms. |
-class PasswordAutofillAgent : public content::RenderFrameObserver { |
+class PasswordAutofillAgent : public content::RenderFrameObserver, |
+ public mojom::PasswordAutofillAgent { |
public: |
explicit PasswordAutofillAgent(content::RenderFrame* render_frame); |
~PasswordAutofillAgent() override; |
+ void BindRequest(mojom::PasswordAutofillAgentRequest request); |
+ |
void SetAutofillAgent(AutofillAgent* autofill_agent); |
+ const mojom::PasswordManagerDriverPtr& GetPasswordManagerDriver(); |
+ |
+ // mojom::PasswordAutofillAgent: |
+ void FillPasswordForm(int key, |
+ const PasswordFormFillData& form_data) override; |
+ void SetLoggingState(bool active) override; |
+ void AutofillUsernameAndPasswordDataReceived( |
+ const FormsPredictionsMap& predictions) override; |
+ void FindFocusedPasswordForm( |
+ const FindFocusedPasswordFormCallback& callback) override; |
+ |
// WebFrameClient editor related calls forwarded by AutofillAgent. |
// If they return true, it indicates the event was consumed and should not |
// be used for any other autofill activity. |
@@ -166,7 +182,6 @@ class PasswordAutofillAgent : public content::RenderFrameObserver { |
}; |
// RenderFrameObserver: |
- bool OnMessageReceived(const IPC::Message& message) override; |
void DidFinishDocumentLoad() override; |
void DidFinishLoad() override; |
void FrameDetached() override; |
@@ -178,13 +193,6 @@ class PasswordAutofillAgent : public content::RenderFrameObserver { |
void WillSubmitForm(const blink::WebFormElement& form) override; |
void OnDestruct() override; |
- // RenderView IPC handlers: |
- void OnFillPasswordForm(int key, const PasswordFormFillData& form_data); |
- void OnSetLoggingState(bool active); |
- void OnAutofillUsernameAndPasswordDataReceived( |
- const FormsPredictionsMap& predictions); |
- void OnFindFocusedPasswordForm(); |
- |
// Scans the given frame for password forms and sends them up to the browser. |
// If |only_visible| is true, only forms visible in the layout are sent. |
void SendPasswordForms(bool only_visible); |
@@ -270,6 +278,10 @@ class PasswordAutofillAgent : public content::RenderFrameObserver { |
AutofillAgent* autofill_agent_; // Weak reference. |
+ mojom::PasswordManagerDriverPtr password_manager_driver_; |
+ |
+ mojo::Binding<mojom::PasswordAutofillAgent> binding_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |
}; |