Chromium Code Reviews| Index: components/autofill/content/renderer/autofill_agent.h |
| diff --git a/components/autofill/content/renderer/autofill_agent.h b/components/autofill/content/renderer/autofill_agent.h |
| index 23f73922a23c30ddbcb36514367c5c02cb452cb2..f9afbec265c5d664d62fa41d66721fcf73a95a4b 100644 |
| --- a/components/autofill/content/renderer/autofill_agent.h |
| +++ b/components/autofill/content/renderer/autofill_agent.h |
| @@ -17,8 +17,8 @@ |
| #include "components/autofill/content/common/autofill_driver.mojom.h" |
| #include "components/autofill/content/renderer/form_cache.h" |
| #include "components/autofill/content/renderer/page_click_listener.h" |
| +#include "components/autofill/content/renderer/page_click_tracker.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/WebAutofillClient.h" |
| #include "third_party/WebKit/public/web/WebFormControlElement.h" |
| @@ -84,6 +84,11 @@ class AutofillAgent : public content::RenderFrameObserver, |
| void ShowNotSecureWarning(const blink::WebInputElement& element); |
| + void set_page_click_tracker_for_testing( |
| + PageClickTracker* page_click_tracker) { |
|
vabr (Chromium)
2017/04/14 06:44:24
Please change the declaration to require unique_pt
EhsanK
2017/04/18 17:55:19
Thanks! Noted. Done.
|
| + page_click_tracker_.reset(page_click_tracker); |
| + } |
| + |
| protected: |
| // blink::WebAutofillClient: |
| void DidAssociateFormControlsDynamically() override; |
| @@ -95,29 +100,6 @@ class AutofillAgent : public content::RenderFrameObserver, |
| bool operator()(const FormData& lhs, const FormData& rhs) const; |
| }; |
| - // Thunk class for RenderViewObserver methods that haven't yet been migrated |
| - // to RenderFrameObserver. Should eventually be removed. |
| - // http://crbug.com/433486 |
| - class LegacyAutofillAgent : public content::RenderViewObserver { |
| - public: |
| - LegacyAutofillAgent(content::RenderView* render_view, AutofillAgent* agent); |
| - ~LegacyAutofillAgent() override; |
| - |
| - // Shuts the LegacyAutofillAgent down on RenderFrame deletion. Safe to call |
| - // multiple times. |
| - void Shutdown(); |
| - |
| - private: |
| - // content::RenderViewObserver: |
| - void OnDestruct() override; |
| - void FocusChangeComplete() override; |
| - |
| - AutofillAgent* agent_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(LegacyAutofillAgent); |
| - }; |
| - friend class LegacyAutofillAgent; |
| - |
| // Flags passed to ShowSuggestions. |
| struct ShowSuggestionsOptions { |
| // All fields are default initialized to false. |
| @@ -169,10 +151,6 @@ class AutofillAgent : public content::RenderFrameObserver, |
| // times. |
| void Shutdown(); |
| - // Pass-through from LegacyAutofillAgent. This correlates with the |
| - // RenderViewObserver method. |
| - void FocusChangeComplete(); |
| - |
| // PageClickListener: |
| void FormControlElementClicked(const blink::WebFormControlElement& element, |
| bool was_focused) override; |
| @@ -187,6 +165,9 @@ class AutofillAgent : public content::RenderFrameObserver, |
| void DataListOptionsChanged(const blink::WebInputElement& element) override; |
| void UserGestureObserved() override; |
| void AjaxSucceeded() override; |
| + void DidCompleteFocusChangeInFrame() override; |
| + void DidReceiveLeftMouseDownOrGestureTapInNode( |
| + const blink::WebNode& node) override; |
| // Called when a same-document navigation is detected. |
| void OnSameDocumentNavigationCompleted(); |
| @@ -259,9 +240,6 @@ class AutofillAgent : public content::RenderFrameObserver, |
| PasswordAutofillAgent* password_autofill_agent_; // Weak reference. |
| PasswordGenerationAgent* password_generation_agent_; // Weak reference. |
| - // Passes through RenderViewObserver methods to |this|. |
| - LegacyAutofillAgent legacy_; |
| - |
| // The ID of the last request sent for form field Autofill. Used to ignore |
| // out of date responses. |
| int autofill_query_id_; |
| @@ -298,6 +276,11 @@ class AutofillAgent : public content::RenderFrameObserver, |
| // for the password manager. TODO(gcasto): Have both UIs show on focus. |
| bool is_generation_popup_possibly_visible_; |
| + // This object must be constructed after AutofillAgent so that password |
|
vabr (Chromium)
2017/04/14 06:44:24
This comment, explained in https://codereview.chro
EhsanK
2017/04/18 17:55:19
Done. Thanks for clarification!
|
| + // generation UI is shown before password manager UI |
| + // (see https://crbug.com/498545). |
| + std::unique_ptr<PageClickTracker> page_click_tracker_; |
| + |
| mojo::Binding<mojom::AutofillAgent> binding_; |
| mojom::AutofillDriverPtr autofill_driver_; |