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

Unified Diff: Source/web/ChromeClientImpl.cpp

Issue 72543005: Get rid of explict editor dependency from text field (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-11-15T16:10:10 Created 7 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
Index: Source/web/ChromeClientImpl.cpp
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index 9890f9f148f9a4c3f33ab7de80d928541f249f42..298694681b113bee98a2c1dff6070f445d9099c1 100644
--- a/Source/web/ChromeClientImpl.cpp
+++ b/Source/web/ChromeClientImpl.cpp
@@ -52,6 +52,7 @@
#include "WebFrameImpl.h"
#include "WebInputElement.h"
#include "WebInputEvent.h"
+#include "WebInputEventConversion.h"
#include "WebKit.h"
#include "WebNode.h"
#include "WebPasswordGeneratorClient.h"
@@ -983,6 +984,38 @@ void ChromeClientImpl::didAssociateFormControls(const Vector<RefPtr<Element> >&
m_webView->autofillClient()->didAssociateFormControls(elementVector);
}
+bool ChromeClientImpl::doTextFieldCommandFromEvent(HTMLInputElement* inputElement, KeyboardEvent* event)
+{
+ if (!m_webView->autofillClient())
+ return false;
+
+ m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(inputElement), WebKeyboardEventBuilder(*event));
+
+ // The Mac code appears to use this method as a hook to implement special
+ // keyboard commands specific to Safari's auto-fill implementation. We
+ // just return false to allow the default action.
+ return false;
+}
+
+void ChromeClientImpl::textDidChangeInTextField(HTMLInputElement* inputElement)
+{
+ if (!m_webView->autofillClient())
+ return;
+ m_webView->autofillClient()->textFieldDidChange(WebInputElement(inputElement));
+}
+
+void ChromeClientImpl::textFieldDidEndEditing(HTMLInputElement* inputElement)
+{
+ if (m_webView->autofillClient())
+ m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(inputElement));
+
+ // Notification that focus was lost. Be careful with this, it's also sent
+ // when the page is being closed.
+
+ // Hide any showing popup.
+ m_webView->hideAutofillPopup();
+}
+
#if ENABLE(NAVIGATOR_CONTENT_UTILS)
PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::create(WebViewImpl* webView)
{

Powered by Google App Engine
This is Rietveld 408576698