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

Unified Diff: components/autofill/content/renderer/password_generation_agent.h

Issue 2274783002: Revert of [Autofill] Migrate ContentPasswordManagerDriver<-->Password{Autofill,Generation}Agent IPCs to mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/autofill/content/renderer/password_generation_agent.h
diff --git a/components/autofill/content/renderer/password_generation_agent.h b/components/autofill/content/renderer/password_generation_agent.h
index df2b9a7a7e757afbf3579a9dd089b5dc0c960d49..47f3a912e3e6da05d171765c93e1f8cd697a7d8a 100644
--- a/components/autofill/content/renderer/password_generation_agent.h
+++ b/components/autofill/content/renderer/password_generation_agent.h
@@ -14,10 +14,7 @@
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
-#include "components/autofill/content/public/interfaces/autofill_agent.mojom.h"
-#include "components/autofill/content/public/interfaces/autofill_driver.mojom.h"
#include "content/public/renderer/render_frame_observer.h"
-#include "mojo/public/cpp/bindings/binding.h"
#include "third_party/WebKit/public/web/WebInputElement.h"
#include "url/gurl.h"
@@ -35,25 +32,11 @@
// This class is responsible for controlling communication for password
// generation between the browser (which shows the popup and generates
// passwords) and WebKit (shows the generation icon in the password field).
-class PasswordGenerationAgent : public content::RenderFrameObserver,
- public mojom::PasswordGenerationAgent {
+class PasswordGenerationAgent : public content::RenderFrameObserver {
public:
PasswordGenerationAgent(content::RenderFrame* render_frame,
PasswordAutofillAgent* password_agent);
~PasswordGenerationAgent() override;
-
- void BindRequest(mojom::PasswordGenerationAgentRequest request);
-
- // mojom::PasswordGenerationAgent:
- void FormNotBlacklisted(const PasswordForm& form) override;
- void GeneratedPasswordAccepted(const base::string16& password) override;
- void FoundFormsEligibleForGeneration(
- const std::vector<PasswordFormGenerationData>& forms) override;
- // Sets |generation_element_| to the focused password field and shows a
- // generation popup at this field.
- void UserTriggeredGeneratePassword() override;
- // Enables the form classifier.
- void AllowToRunFormClassifier() override;
// Returns true if the field being changed is one where a generated password
// is being offered. Updates the state of the popup if necessary.
@@ -91,11 +74,16 @@
typedef std::vector<AccountCreationFormData> AccountCreationFormDataList;
// RenderFrameObserver:
+ bool OnMessageReceived(const IPC::Message& message) override;
void DidFinishDocumentLoad() override;
void DidFinishLoad() override;
void OnDestruct() override;
- const mojom::PasswordManagerDriverPtr& GetPasswordManagerDriver();
+ // Message handlers.
+ void OnFormNotBlacklisted(const PasswordForm& form);
+ void OnPasswordAccepted(const base::string16& password);
+ void OnFormsEligibleForGenerationFound(
+ const std::vector<autofill::PasswordFormGenerationData>& forms);
// Helper function that will try and populate |password_elements_| and
// |possible_account_creation_form_|.
@@ -114,6 +102,13 @@
// Hides a password generation popup if one exists.
void HidePopup();
+
+ // Sets |generation_element_| to the focused password field and shows a
+ // generation popup at this field.
+ void OnUserTriggeredGeneratePassword();
+
+ // Enables the form classifier.
+ void OnAllowToRunFormClassifier();
// Runs HTML parsing based classifier and saves its outcome to proto.
// TODO(crbug.com/621442): Remove client-side form classifier when server-side
@@ -182,8 +177,6 @@
// in password fields are updated.
PasswordAutofillAgent* password_agent_;
- mojo::Binding<mojom::PasswordGenerationAgent> binding_;
-
DISALLOW_COPY_AND_ASSIGN(PasswordGenerationAgent);
};

Powered by Google App Engine
This is Rietveld 408576698