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

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

Issue 83023017: Basic autofill into password value on user gesture only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bug fixes Created 7 years, 1 month 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_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..9bc50b88932636374f360c2bdec80157efe7a054 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,22 @@ 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(blink::WebInputElement* element) {
+ elements_.push_back(element);
+ }
+
+ 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 +161,10 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
blink::WebFrame* CurrentOrChildFrameWithSavedForms(
const blink::WebFrame* current_frame);
+ void setUserGestureOccurred(bool occurred) {
Garrett Casto 2013/12/02 23:49:12 Inline functions like this are generally also done
jww 2013/12/03 06:29:59 Done.
+ userGestureOccurred_ = occurred;
+ }
+
// The logins we have filled so far with their associated info.
LoginToPasswordInfoMap login_to_password_info_;
@@ -159,6 +180,10 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_;
Garrett Casto 2013/12/02 23:49:12 WeakPtrFactory should always be the last member va
jww 2013/12/03 06:29:59 Done.
+ AutofillWebUserGestureHandler* gestureHandler_;
Garrett Casto 2013/12/02 23:49:12 These should be unix_hacker_style_ not mixedCase_.
jww 2013/12/03 06:29:59 Done.
+
+ bool userGestureOccurred_;
+
DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);
};

Powered by Google App Engine
This is Rietveld 408576698