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

Side by Side Diff: components/autofill/content/renderer/page_click_tracker.cc

Issue 1977633003: Remove RenderFrameImpl::GetFocusedElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes the right click + blur + copy case. Created 4 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_autofill_agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/content/renderer/page_click_tracker.h" 5 #include "components/autofill/content/renderer/page_click_tracker.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "components/autofill/content/renderer/form_autofill_util.h" 8 #include "components/autofill/content/renderer/form_autofill_util.h"
9 #include "components/autofill/content/renderer/page_click_listener.h" 9 #include "components/autofill/content/renderer/page_click_listener.h"
10 #include "components/autofill/core/common/autofill_util.h" 10 #include "components/autofill/core/common/autofill_util.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 void PageClickTracker::FocusChangeComplete() { 83 void PageClickTracker::FocusChangeComplete() {
84 if (IsKeyboardAccessoryEnabled()) 84 if (IsKeyboardAccessoryEnabled())
85 return; 85 return;
86 86
87 DoFocusChangeComplete(); 87 DoFocusChangeComplete();
88 } 88 }
89 89
90 void PageClickTracker::DoFocusChangeComplete() { 90 void PageClickTracker::DoFocusChangeComplete() {
91 WebElement focused_element = render_frame()->GetFocusedElement(); 91 WebElement focused_element =
92 render_frame()->GetWebFrame()->document().focusedElement();
92 if (focused_node_was_last_clicked_ && !focused_element.isNull()) { 93 if (focused_node_was_last_clicked_ && !focused_element.isNull()) {
93 const WebFormControlElement control = 94 const WebFormControlElement control =
94 GetTextFormControlElement(focused_element); 95 GetTextFormControlElement(focused_element);
95 if (!control.isNull()) { 96 if (!control.isNull()) {
96 listener_->FormControlElementClicked(control, 97 listener_->FormControlElementClicked(control,
97 was_focused_before_now_); 98 was_focused_before_now_);
98 } 99 }
99 } 100 }
100 101
101 was_focused_before_now_ = true; 102 was_focused_before_now_ = true;
(...skipping 13 matching lines...) Expand all
115 116
116 void PageClickTracker::Legacy::OnMouseDown(const WebNode& mouse_down_node) { 117 void PageClickTracker::Legacy::OnMouseDown(const WebNode& mouse_down_node) {
117 tracker_->OnMouseDown(mouse_down_node); 118 tracker_->OnMouseDown(mouse_down_node);
118 } 119 }
119 120
120 void PageClickTracker::Legacy::FocusChangeComplete() { 121 void PageClickTracker::Legacy::FocusChangeComplete() {
121 tracker_->FocusChangeComplete(); 122 tracker_->FocusChangeComplete();
122 } 123 }
123 124
124 } // namespace autofill 125 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698