Chromium Code Reviews| 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 503621bfda784a66f10f0c755a7f1af015e40b47..cef8217b82c8f166ac5ce56bca65ad1ce687a1ff 100644 |
| --- a/components/autofill/content/renderer/password_autofill_agent.h |
| +++ b/components/autofill/content/renderer/password_autofill_agent.h |
| @@ -13,6 +13,7 @@ |
| #include "components/autofill/core/common/password_form_fill_data.h" |
| #include "content/public/renderer/render_view_observer.h" |
| #include "third_party/WebKit/public/web/WebInputElement.h" |
| +#include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| namespace blink { |
| class WebInputElement; |
| @@ -79,6 +80,26 @@ class PasswordAutofillAgent : public content::RenderViewObserver { |
| typedef std::map<blink::WebFrame*, |
| linked_ptr<PasswordForm> > FrameToPasswordFormMap; |
| + class AutofillWebUserGestureHandler : public blink::WebUserGestureHandler { |
| + public: |
| + AutofillWebUserGestureHandler(PasswordAutofillAgent* agent); |
| + virtual ~AutofillWebUserGestureHandler(); |
| + |
| + void addElement(const blink::WebInputElement& element) { |
| + elements_.push_back(element); |
| + } |
| + |
| + void clearElements() { |
| + elements_.clear(); |
| + } |
| + |
| + virtual void onGesture(); |
| + |
| + private: |
| + PasswordAutofillAgent* agent_; |
| + std::vector<blink::WebInputElement> elements_; |
| + }; |
| + |
| // RenderViewObserver: |
| virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| virtual void DidStartProvisionalLoad(blink::WebFrame* frame) OVERRIDE; |
| @@ -144,6 +165,10 @@ class PasswordAutofillAgent : public content::RenderViewObserver { |
| blink::WebFrame* CurrentOrChildFrameWithSavedForms( |
| const blink::WebFrame* current_frame); |
| + void set_user_gesture_occurred(bool occurred) { |
| + user_gesture_occurred_ = occurred; |
| + } |
| + |
| // The logins we have filled so far with their associated info. |
| LoginToPasswordInfoMap login_to_password_info_; |
| @@ -157,6 +182,10 @@ class PasswordAutofillAgent : public content::RenderViewObserver { |
| // but the submit may still fail (i.e. doesn't pass JavaScript validation). |
| FrameToPasswordFormMap provisionally_saved_forms_; |
| + AutofillWebUserGestureHandler* gestureHandler_; |
|
Garrett Casto
2013/12/04 00:25:31
gesture_handler_. Also this should be a scoped_ptr
jww
2013/12/04 00:45:11
Done.
|
| + |
| + bool user_gesture_occurred_; |
| + |
| base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |