diff options
author | keishi@chromium.org <keishi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 04:01:54 +0000 |
---|---|---|
committer | keishi@chromium.org <keishi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 04:01:54 +0000 |
commit | 1508e4f949c88b60cb78fb03156ed03ffd14ffb5 (patch) | |
tree | 0fbc8680014ed5de4b8506600649a35f07d2e64f | |
parent | d204b6b86b30f2341a75f0b072e5b13b306d6651 (diff) | |
download | chromium_src-1508e4f949c88b60cb78fb03156ed03ffd14ffb5.zip chromium_src-1508e4f949c88b60cb78fb03156ed03ffd14ffb5.tar.gz chromium_src-1508e4f949c88b60cb78fb03156ed03ffd14ffb5.tar.bz2 |
Open autofill popup when clicking on any text field input element, not just input type=text
BUG=126623
TEST=
Review URL: https://chromiumcodereview.appspot.com/10332065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137358 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/page_click_tracker.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/renderer/page_click_tracker.cc b/chrome/renderer/page_click_tracker.cc index a856c5c..9e40679 100644 --- a/chrome/renderer/page_click_tracker.cc +++ b/chrome/renderer/page_click_tracker.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/renderer/page_click_tracker.h" #include "chrome/common/render_messages.h" +#include "chrome/renderer/autofill/form_autofill_util.h" #include "chrome/renderer/page_click_listener.h" #include "content/public/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" @@ -29,19 +30,17 @@ using WebKit::WebView; namespace { // Casts |node| to a WebInputElement. -// Returns an empty (isNull()) WebInputElement if |node| is not a text -// WebInputElement. +// Returns an empty (isNull()) WebInputElement if |node| is not a text field. const WebInputElement GetTextWebInputElement(const WebNode& node) { if (!node.isElementNode()) return WebInputElement(); const WebElement element = node.toConst<WebElement>(); - if (!element.isFormControlElement()) + if (!element.hasTagName("input")) return WebInputElement(); - const WebFormControlElement control = - element.toConst<WebFormControlElement>(); - if (control.formControlType() != WebString::fromUTF8("text")) + const WebInputElement* input = WebKit::toWebInputElement(&element); + if (!autofill::IsTextInput(input)) return WebInputElement(); - return element.toConst<WebInputElement>(); + return *input; } // Checks to see if a text field was the previously selected node and is now |