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

Unified Diff: content/renderer/render_view_impl.cc

Issue 2853623002: [refactor] Fix autofill features for payments when the form is inside an OOPIF (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
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() {
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698