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

Unified Diff: components/autofill/content/browser/content_autofill_driver.h

Issue 2762233004: Fix autofill popup controller key press callback registration (Closed)
Patch Set: Fix typo Created 3 years, 8 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/browser/content_autofill_driver.h
diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h
index 0f6fb0840272be4583cfab51ebf829f634e92d25..f038f76f89cd47cc727c9dedceec7df5e70464f0 100644
--- a/components/autofill/content/browser/content_autofill_driver.h
+++ b/components/autofill/content/browser/content_autofill_driver.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/supports_user_data.h"
+#include "components/autofill/content/browser/key_press_handler_manager.h"
#include "components/autofill/content/common/autofill_agent.mojom.h"
#include "components/autofill/content/common/autofill_driver.mojom.h"
#include "components/autofill/core/browser/autofill_driver.h"
@@ -29,7 +30,8 @@ class AutofillClient;
// communication from the renderer and from the external world. There is one
// instance per RenderFrameHost.
class ContentAutofillDriver : public AutofillDriver,
- public mojom::AutofillDriver {
+ public mojom::AutofillDriver,
+ public KeyPressHandlerManager::Delegate {
public:
ContentAutofillDriver(
content::RenderFrameHost* render_frame_host,
@@ -103,12 +105,23 @@ class ContentAutofillDriver : public AutofillDriver,
const mojom::AutofillAgentPtr& GetAutofillAgent();
+ // Methods forwarded to key_press_handler_manager_.
+ void RegisterKeyPressHandler(
+ const content::RenderWidgetHost::KeyPressEventCallback& handler);
+ void RemoveKeyPressHandler();
+
protected:
// Sets the manager to |manager| and sets |manager|'s external delegate
// to |autofill_external_delegate_|. Takes ownership of |manager|.
void SetAutofillManager(std::unique_ptr<AutofillManager> manager);
private:
+ // KeyPressHandlerManager::Delegate:
+ void AddHandler(
+ const content::RenderWidgetHost::KeyPressEventCallback& handler) override;
+ void RemoveHandler(
+ const content::RenderWidgetHost::KeyPressEventCallback& handler) override;
+
// Weak ref to the RenderFrameHost the driver is associated with. Should
// always be non-NULL and valid for lifetime of |this|.
content::RenderFrameHost* const render_frame_host_;
@@ -124,6 +137,8 @@ class ContentAutofillDriver : public AutofillDriver,
// case where the Autofill native UI is enabled.
AutofillExternalDelegate autofill_external_delegate_;
+ KeyPressHandlerManager key_press_handler_manager_;
+
mojo::Binding<mojom::AutofillDriver> binding_;
mojom::AutofillAgentPtr autofill_agent_;
« no previous file with comments | « components/autofill/content/browser/BUILD.gn ('k') | components/autofill/content/browser/content_autofill_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698