Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: components/password_manager/content/browser/content_password_manager_driver.h

Issue 2216463002: [Autofill] Migrate ContentPasswordManagerDriver<-->Password{Autofill,Generation}Agent IPCs to mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nit from Vaclav Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/content/browser/content_password_manager_driver.h
diff --git a/components/password_manager/content/browser/content_password_manager_driver.h b/components/password_manager/content/browser/content_password_manager_driver.h
index 0660883d2f9da36ef7a590043570984c781b0f41..e4ed94cd1210fa1935b1dbcaf839ac4e528e4ea5 100644
--- a/components/password_manager/content/browser/content_password_manager_driver.h
+++ b/components/password_manager/content/browser/content_password_manager_driver.h
@@ -11,12 +11,14 @@
#include "base/compiler_specific.h"
#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/core/common/password_form_field_prediction_map.h"
#include "components/autofill/core/common/password_form_generation_data.h"
#include "components/password_manager/core/browser/password_autofill_manager.h"
#include "components/password_manager/core/browser/password_generation_manager.h"
#include "components/password_manager/core/browser/password_manager.h"
#include "components/password_manager/core/browser/password_manager_driver.h"
+#include "mojo/public/cpp/bindings/binding.h"
namespace autofill {
class AutofillManager;
@@ -39,7 +41,9 @@ enum class BadMessageReason;
// There is one ContentPasswordManagerDriver per RenderFrameHost.
// The lifetime is managed by the ContentPasswordManagerDriverFactory.
-class ContentPasswordManagerDriver : public PasswordManagerDriver {
+class ContentPasswordManagerDriver
+ : public PasswordManagerDriver,
+ public autofill::mojom::PasswordManagerDriver {
public:
ContentPasswordManagerDriver(content::RenderFrameHost* render_frame_host,
PasswordManagerClient* client,
@@ -50,6 +54,8 @@ class ContentPasswordManagerDriver : public PasswordManagerDriver {
static ContentPasswordManagerDriver* GetForRenderFrameHost(
content::RenderFrameHost* render_frame_host);
+ void BindRequest(autofill::mojom::PasswordManagerDriverRequest request);
+
// PasswordManagerDriver implementation.
void FillPasswordForm(
const autofill::PasswordFormFillData& form_data) override;
@@ -78,25 +84,36 @@ class ContentPasswordManagerDriver : public PasswordManagerDriver {
PasswordManager* GetPasswordManager() override;
PasswordAutofillManager* GetPasswordAutofillManager() override;
- bool HandleMessage(const IPC::Message& message);
void DidNavigateFrame(const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params);
- // Pass-throughs to PasswordManager.
- void OnPasswordFormsParsed(const std::vector<autofill::PasswordForm>& forms);
+ // autofill::mojom::PasswordManagerDriver:
+ void PasswordFormsParsed(
+ const std::vector<autofill::PasswordForm>& forms) override;
+ void PasswordFormsRendered(
+ const std::vector<autofill::PasswordForm>& visible_forms,
+ bool did_stop_loading) override;
+ void PasswordFormSubmitted(
+ const autofill::PasswordForm& password_form) override;
+ void InPageNavigation(const autofill::PasswordForm& password_form) override;
+ void PresaveGeneratedPassword(
+ const autofill::PasswordForm& password_form) override;
+ void PasswordNoLongerGenerated(
+ const autofill::PasswordForm& password_form) override;
+ void ShowPasswordSuggestions(int key,
+ base::i18n::TextDirection text_direction,
+ const base::string16& typed_username,
+ int options,
+ const gfx::RectF& bounds) override;
+ void PasswordAutofillAgentConstructed() override;
+ void RecordSavePasswordProgress(const std::string& log) override;
+ void SaveGenerationFieldDetectedByClassifier(
+ const autofill::PasswordForm& password_form,
+ const base::string16& generation_field) override;
+
void OnPasswordFormsParsedNoRenderCheck(
const std::vector<autofill::PasswordForm>& forms);
- void OnPasswordFormsRendered(
- const std::vector<autofill::PasswordForm>& visible_forms,
- bool did_stop_loading);
- void OnPasswordFormSubmitted(const autofill::PasswordForm& password_form);
- void OnInPageNavigation(const autofill::PasswordForm& password_form);
- void OnPresaveGeneratedPassword(const autofill::PasswordForm& password_form);
- void OnPasswordNoLongerGenerated(const autofill::PasswordForm& password_form);
void OnFocusedPasswordFormFound(const autofill::PasswordForm& password_form);
- void OnSaveGenerationFieldDetectedByClassifier(
- const autofill::PasswordForm& password_form,
- const base::string16& generation_field);
private:
bool CheckChildProcessSecurityPolicy(const GURL& url,
@@ -104,6 +121,11 @@ class ContentPasswordManagerDriver : public PasswordManagerDriver {
const autofill::mojom::AutofillAgentPtr& GetAutofillAgent();
+ const autofill::mojom::PasswordAutofillAgentPtr& GetPasswordAutofillAgent();
+
+ const autofill::mojom::PasswordGenerationAgentPtr&
+ GetPasswordGenerationAgent();
+
content::RenderFrameHost* render_frame_host_;
PasswordManagerClient* client_;
PasswordGenerationManager password_generation_manager_;
@@ -115,6 +137,14 @@ class ContentPasswordManagerDriver : public PasswordManagerDriver {
// it to each other over IPC. The counter below is used to generate new IDs.
int next_free_key_;
+ autofill::mojom::PasswordAutofillAgentPtr password_autofill_agent_;
+
+ autofill::mojom::PasswordGenerationAgentPtr password_gen_agent_;
+
+ mojo::Binding<autofill::mojom::PasswordManagerDriver> binding_;
+
+ base::WeakPtrFactory<ContentPasswordManagerDriver> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ContentPasswordManagerDriver);
};

Powered by Google App Engine
This is Rietveld 408576698