Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 46b04e047392f71c8e84ee1d9668fa0682a82903..72548a2aaf6da1510694f5f31bf1349c2d39309e 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -335,11 +335,6 @@ void WebViewImpl::setMainFrame(WebFrame* frame) |
toWebRemoteFrameImpl(frame)->initializeCoreFrame(&page()->frameHost(), 0, nullAtom); |
} |
-void WebViewImpl::setAutofillClient(WebAutofillClient* autofillClient) |
-{ |
- m_autofillClient = autofillClient; |
-} |
- |
void WebViewImpl::setCredentialManagerClient(WebCredentialManagerClient* webCredentialManagerClient) |
{ |
ASSERT(m_page); |
@@ -367,7 +362,6 @@ void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) |
WebViewImpl::WebViewImpl(WebViewClient* client) |
: m_client(client) |
- , m_autofillClient(0) |
, m_spellCheckClient(0) |
, m_chromeClientImpl(this) |
, m_contextMenuClientImpl(this) |
@@ -2038,7 +2032,8 @@ static String inputTypeToName(WebInputEvent::Type type) |
bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) |
{ |
- UserGestureNotifier notifier(m_autofillClient, &m_userGestureObserved); |
+ WebAutofillClient* 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 +2041,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()); |
@@ -2167,13 +2162,14 @@ 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); |
+ WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(toLocalFrame(focusedFrame.get())); |
+ if (webframe->autofillClient()) |
+ webframe->autofillClient()->setIgnoreTextChanges(true); |
toLocalFrame(focusedFrame.get())->inputMethodController().confirmComposition(); |
- if (m_autofillClient) |
- m_autofillClient->setIgnoreTextChanges(false); |
+ if (webframe->autofillClient()) |
+ webframe->autofillClient()->setIgnoreTextChanges(false); |
} |
m_imeAcceptEvents = false; |
} |
@@ -3555,7 +3551,7 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, |
{ |
ASSERT(m_currentDragData); |
- UserGestureNotifier notifier(m_autofillClient, &m_userGestureObserved); |
+ UserGestureNotifier notifier(mainFrameImpl() ? mainFrameImpl()->autofillClient() : 0, &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- |