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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 737853002: Refactor Autofill for OOPIF, step 1: add autofillClient to WebLocalFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fn ordering Created 6 years, 1 month 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 | « Source/web/WebLocalFrameImpl.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index ecc6a4f4e63c301d8203920a26c457764d7381a7..396cb4ab033ece5de8f93062cd15300fcd0361c8 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2038,7 +2038,9 @@ static String inputTypeToName(WebInputEvent::Type type)
bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
{
- UserGestureNotifier notifier(m_autofillClient, &m_userGestureObserved);
+ WebAutofillClient* autofillClient = m_autofillClient ? m_autofillClient :
+ mainFrameImpl() ? mainFrameImpl()->autofillClient() : 0;
+ UserGestureNotifier notifier(autofillClient, &m_userGestureObserved);
// On the first input event since page load, |notifier| instructs the
// autofill client to unblock values of password input fields of any forms
// on the page. There is a single input event, GestureTap, which can both
@@ -2046,9 +2048,9 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
// case, the form submission happens before the autofill client is told
// to unblock the password values, and so the password values are not
// submitted. To avoid that, GestureTap is handled explicitly:
- if (inputEvent.type == WebInputEvent::GestureTap && m_autofillClient) {
+ if (inputEvent.type == WebInputEvent::GestureTap && autofillClient) {
m_userGestureObserved = true;
- m_autofillClient->firstUserGestureObserved();
+ autofillClient->firstUserGestureObserved();
}
TRACE_EVENT1("input", "WebViewImpl::handleInputEvent", "type", inputTypeToName(inputEvent.type).ascii());
@@ -2067,8 +2069,8 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
TemporaryChange<const WebInputEvent*> currentEventChange(m_currentInputEvent, &inputEvent);
if (isPointerLocked() && WebInputEvent::isMouseEventType(inputEvent.type)) {
- pointerLockMouseEvent(inputEvent);
- return true;
+ pointerLockMouseEvent(inputEvent);
+ return true;
}
if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type)) {
@@ -2167,13 +2169,16 @@ void WebViewImpl::setFocus(bool enable)
if (focusedFrame && focusedFrame->isLocalFrame()) {
// Finish an ongoing composition to delete the composition node.
if (toLocalFrame(focusedFrame.get())->inputMethodController().hasComposition()) {
- if (m_autofillClient)
- m_autofillClient->setIgnoreTextChanges(true);
+ WebAutofillClient* autofillClient = m_autofillClient ? m_autofillClient :
+ WebLocalFrameImpl::fromFrame(toLocalFrame(focusedFrame.get()))->autofillClient();
+
+ if (autofillClient)
+ autofillClient->setIgnoreTextChanges(true);
toLocalFrame(focusedFrame.get())->inputMethodController().confirmComposition();
- if (m_autofillClient)
- m_autofillClient->setIgnoreTextChanges(false);
+ if (autofillClient)
+ autofillClient->setIgnoreTextChanges(false);
}
m_imeAcceptEvents = false;
}
@@ -3570,7 +3575,9 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint,
{
ASSERT(m_currentDragData);
- UserGestureNotifier notifier(m_autofillClient, &m_userGestureObserved);
+ WebAutofillClient* autofillClient = m_autofillClient ? m_autofillClient :
+ mainFrameImpl() ? mainFrameImpl()->autofillClient() : 0;
+ UserGestureNotifier notifier(autofillClient, &m_userGestureObserved);
// If this webview transitions from the "drop accepting" state to the "not
// accepting" state, then our IPC message reply indicating that may be in-
« no previous file with comments | « Source/web/WebLocalFrameImpl.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698