Chromium Code Reviews| Index: components/autofill/renderer/page_click_tracker.cc |
| diff --git a/components/autofill/renderer/page_click_tracker.cc b/components/autofill/renderer/page_click_tracker.cc |
| index f1aae33733e1ec594e68507210cee9cdfbc5706b..812def163bd909b51c0dc68603169e94d994181e 100644 |
| --- a/components/autofill/renderer/page_click_tracker.cc |
| +++ b/components/autofill/renderer/page_click_tracker.cc |
| @@ -20,9 +20,11 @@ using WebKit::WebDOMMouseEvent; |
| using WebKit::WebElement; |
| using WebKit::WebFormControlElement; |
| using WebKit::WebFrame; |
| +using WebKit::WebGestureEvent; |
| using WebKit::WebInputElement; |
| using WebKit::WebInputEvent; |
| using WebKit::WebMouseEvent; |
| +using WebKit::WebTouchEvent; |
| using WebKit::WebNode; |
| using WebKit::WebString; |
| using WebKit::WebView; |
| @@ -87,7 +89,31 @@ void PageClickTracker::DidHandleMouseEvent(const WebMouseEvent& event) { |
| return; |
| bool is_focused = (last_node_clicked_ == render_view()->GetFocusedNode()); |
| - listener_->InputElementClicked(input_element, was_focused_, is_focused); |
| + listener_->InputElementClicked(input_element, |
| + was_focused_, |
| + is_focused, |
| + MOUSE_CLICK); |
| +} |
| + |
| +void PageClickTracker::DidHandleGestureEvent( |
| + const WebKit::WebGestureEvent& event) { |
| + if (event.type != WebInputEvent::GestureTap) |
| + return; |
| + |
| + if (last_node_clicked_.isNull()) |
| + return; |
| + |
| + // We are only interested in text field clicks. |
| + const WebInputElement input_element = |
| + GetTextWebInputElement(last_node_clicked_); |
| + if (input_element.isNull()) |
| + return; |
| + |
| + bool is_focused = (last_node_clicked_ == render_view()->GetFocusedNode()); |
| + listener_->InputElementClicked(input_element, |
| + was_focused_, |
| + is_focused, |
| + TAP_GESTURE); |
|
Ilya Sherman
2013/06/06 09:25:35
Please refactor the code so that the common parts
nyquist
2013/06/07 22:51:10
Done in the other CL.
|
| } |
| void PageClickTracker::DidFinishDocumentLoad(WebKit::WebFrame* frame) { |