Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index 7d6113cf65bf6f2f7270097e668eff44b6c7feb7..b7af238138e57dad5913ced27efa9ac7c90b3904 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -130,6 +130,7 @@ |
| #include "third_party/WebKit/public/platform/WebVector.h" |
| #include "third_party/WebKit/public/public_features.h" |
| #include "third_party/WebKit/public/web/WebAXObject.h" |
| +#include "third_party/WebKit/public/web/WebAutofillClient.h" |
| #include "third_party/WebKit/public/web/WebColorSuggestion.h" |
| #include "third_party/WebKit/public/web/WebDOMEvent.h" |
| #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" |
| @@ -1169,11 +1170,6 @@ void RenderViewImpl::TransferActiveWheelFlingAnimation( |
| // RenderWidgetInputHandlerDelegate ----------------------------------------- |
| -void RenderViewImpl::RenderWidgetFocusChangeComplete() { |
| - for (auto& observer : observers_) |
| - observer.FocusChangeComplete(); |
| -} |
| - |
| bool RenderViewImpl::DoesRenderWidgetHaveTouchEventHandlersAt( |
| const gfx::Point& point) const { |
| if (!webview()) |
| @@ -1312,9 +1308,13 @@ void RenderViewImpl::OnMoveCaret(const gfx::Point& point) { |
| void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( |
| const gfx::Rect& rect) { |
| + blink::WebAutofillClient* autofill_client = nullptr; |
| + if (auto* focused_frame = GetWebView()->FocusedFrame()) |
| + autofill_client = focused_frame->AutofillClient(); |
| + |
| if (has_scrolled_focused_editable_node_into_rect_ && |
| - rect == rect_for_scrolled_focused_editable_node_) { |
| - GetWidget()->FocusChangeComplete(); |
| + rect == rect_for_scrolled_focused_editable_node_ && autofill_client) { |
| + autofill_client->DidCompleteFocusChangeInFrame(); |
|
dcheng
2017/04/18 04:41:50
It seems a bit awkward that we're in content, but
vabr (Chromium)
2017/04/18 07:17:02
I don't immediately see a better option now, and I
EhsanK
2017/04/18 17:55:19
I am not quite sure. There is no apparent content/
|
| return; |
| } |
| @@ -1323,8 +1323,8 @@ void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( |
| rect_for_scrolled_focused_editable_node_ = rect; |
| has_scrolled_focused_editable_node_into_rect_ = true; |
| - if (!compositor()->HasPendingPageScaleAnimation()) |
| - GetWidget()->FocusChangeComplete(); |
| + if (!compositor()->HasPendingPageScaleAnimation() && autofill_client) |
| + autofill_client->DidCompleteFocusChangeInFrame(); |
| } |
| void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, |
| @@ -1803,10 +1803,6 @@ void RenderViewImpl::Show(WebNavigationPolicy policy) { |
| RenderWidget::Show(policy); |
| } |
| -void RenderViewImpl::OnMouseDown(const WebNode& mouse_down_node) { |
| - for (auto& observer : observers_) |
| - observer.OnMouseDown(mouse_down_node); |
| -} |
| bool RenderViewImpl::CanHandleGestureEvent() { |
| return true; |
| @@ -2327,7 +2323,10 @@ void RenderViewImpl::SetFocus(bool enable) { |
| } |
| void RenderViewImpl::DidCompletePageScaleAnimation() { |
| - GetWidget()->FocusChangeComplete(); |
| + if (auto* focused_frame = GetWebView()->FocusedFrame()) { |
| + if (focused_frame->AutofillClient()) |
| + focused_frame->AutofillClient()->DidCompleteFocusChangeInFrame(); |
| + } |
| } |
| void RenderViewImpl::OnDeviceScaleFactorChanged() { |