<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166890] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166890">166890</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2014-04-07 16:00:04 -0700 (Mon, 07 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add API::InjectedBundle::FormClient
https://bugs.webkit.org/show_bug.cgi?id=131317

Reviewed by Anders Carlsson.

* WebKit2.xcodeproj/project.pbxproj: Added reference to new file.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetFormClient):
* WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Changed to define and
create a FormClient (which derives from API::InjectedBundle::FormClient and messages a
delegate), and set it as the form client.
(didFocusTextField): Deleted.
(willSubmitForm): Deleted.
(setUpFormClient): Deleted.

* WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: Added.
(API::InjectedBundle::FormClient::~FormClient):
(API::InjectedBundle::FormClient::didFocusTextField):
(API::InjectedBundle::FormClient::textFieldDidBeginEditing):
(API::InjectedBundle::FormClient::textFieldDidEndEditing):
(API::InjectedBundle::FormClient::textDidChangeInTextField):
(API::InjectedBundle::FormClient::textDidChangeInTextArea):
(API::InjectedBundle::FormClient::shouldPerformActionInTextField):
(API::InjectedBundle::FormClient::willSubmitForm):
(API::InjectedBundle::FormClient::willSendSubmitEvent):
(API::InjectedBundle::FormClient::didAssociateFormControls):
(API::InjectedBundle::FormClient::shouldNotifyOnFormChanges):

* WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
(WebKit::InjectedBundlePageFormClient::InjectedBundlePageFormClient): Added a constructor
from WKBundlePageFormClientBase.
(WebKit::toWKInputFieldActionType): Added helper to convert from internal enum to C SPI
enum.
(WebKit::InjectedBundlePageFormClient::shouldPerformActionInTextField): Use helper.
* WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Added inheritance from
API::InjectedBundle::FormClient, marked overrides as such.

* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: Removed unused forward
declarations.

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::toInputFieldAction): Added helper to convert from C SPI enum to internal enum.
(WebKit::WebEditorClient::doTextFieldCommandFromEvent): Use helper.
(WebKit::WebEditorClient::textWillBeDeletedInTextField): Ditto.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Initialize m_formClient member.
(WebKit::WebPage::setInjectedBundleFormClient): Added. Updates m_formClient. 
(WebKit::WebPage::close): Updated code to clear m_formClient.
(WebKit::WebPage::initializeInjectedBundleFormClient): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::injectedBundleFormClient): Updated return type.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePageFormClienth">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageFormClientcpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageFormClienth">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageUIClienth">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebEditorClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIInjectedBundleFormClienth">trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2014-04-07  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Add API::InjectedBundle::FormClient
+        https://bugs.webkit.org/show_bug.cgi?id=131317
+
+        Reviewed by Anders Carlsson.
+
+        * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageSetFormClient):
+        * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Changed to define and
+        create a FormClient (which derives from API::InjectedBundle::FormClient and messages a
+        delegate), and set it as the form client.
+        (didFocusTextField): Deleted.
+        (willSubmitForm): Deleted.
+        (setUpFormClient): Deleted.
+
+        * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: Added.
+        (API::InjectedBundle::FormClient::~FormClient):
+        (API::InjectedBundle::FormClient::didFocusTextField):
+        (API::InjectedBundle::FormClient::textFieldDidBeginEditing):
+        (API::InjectedBundle::FormClient::textFieldDidEndEditing):
+        (API::InjectedBundle::FormClient::textDidChangeInTextField):
+        (API::InjectedBundle::FormClient::textDidChangeInTextArea):
+        (API::InjectedBundle::FormClient::shouldPerformActionInTextField):
+        (API::InjectedBundle::FormClient::willSubmitForm):
+        (API::InjectedBundle::FormClient::willSendSubmitEvent):
+        (API::InjectedBundle::FormClient::didAssociateFormControls):
+        (API::InjectedBundle::FormClient::shouldNotifyOnFormChanges):
+
+        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
+        (WebKit::InjectedBundlePageFormClient::InjectedBundlePageFormClient): Added a constructor
+        from WKBundlePageFormClientBase.
+        (WebKit::toWKInputFieldActionType): Added helper to convert from internal enum to C SPI
+        enum.
+        (WebKit::InjectedBundlePageFormClient::shouldPerformActionInTextField): Use helper.
+        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Added inheritance from
+        API::InjectedBundle::FormClient, marked overrides as such.
+
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: Removed unused forward
+        declarations.
+
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::toInputFieldAction): Added helper to convert from C SPI enum to internal enum.
+        (WebKit::WebEditorClient::doTextFieldCommandFromEvent): Use helper.
+        (WebKit::WebEditorClient::textWillBeDeletedInTextField): Ditto.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage): Initialize m_formClient member.
+        (WebKit::WebPage::setInjectedBundleFormClient): Added. Updates m_formClient. 
+        (WebKit::WebPage::close): Updated code to clear m_formClient.
+        (WebKit::WebPage::initializeInjectedBundleFormClient): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::injectedBundleFormClient): Updated return type.
+
</ins><span class="cx"> 2014-04-07  Hyowon Kim  &lt;hw1008.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move to using std::unique_ptr for opengl, texmap, transforms and efl in WebCore/platform/graphics.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -665,6 +665,7 @@
</span><span class="cx">                 3766F9F0189A1248003CF19B /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C79A100E7FC50078DEBC /* WebCore.framework */; };
</span><span class="cx">                 3766F9F1189A1254003CF19B /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BC87DFA91018101400564216 /* libicucore.dylib */; };
</span><span class="cx">                 3769079A18F31CB2001DFF04 /* APIInjectedBundlePageUIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3769079818F31CB2001DFF04 /* APIInjectedBundlePageUIClient.h */; };
</span><ins>+                3769079E18F340A2001DFF04 /* APIInjectedBundleFormClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3769079C18F340A2001DFF04 /* APIInjectedBundleFormClient.h */; };
</ins><span class="cx">                 37694525184FC6B600CDE21F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF5068412431861005955AE /* Security.framework */; };
</span><span class="cx">                 377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */ = {isa = PBXBuildFile; fileRef = 377EAD4417E2C51A002D193D /* WKDeclarationSpecifiers.h */; settings = {ATTRIBUTES = (Public, ); }; };
</span><span class="cx">                 377EAD4817E2C77B002D193D /* WKUserContentInjectedFrames.h in Headers */ = {isa = PBXBuildFile; fileRef = 377EAD4617E2C77B002D193D /* WKUserContentInjectedFrames.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2484,6 +2485,7 @@
</span><span class="cx">                 37608820150414F700FC82C7 /* WKRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKRenderObject.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37608821150414F700FC82C7 /* WKRenderObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKRenderObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3769079818F31CB2001DFF04 /* APIInjectedBundlePageUIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = APIInjectedBundlePageUIClient.h; path = API/APIInjectedBundlePageUIClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                3769079C18F340A2001DFF04 /* APIInjectedBundleFormClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleFormClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 377EAD4417E2C51A002D193D /* WKDeclarationSpecifiers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDeclarationSpecifiers.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 377EAD4617E2C77B002D193D /* WKUserContentInjectedFrames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserContentInjectedFrames.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 377EAD4717E2C77B002D193D /* WKUserScriptInjectionTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserScriptInjectionTime.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5762,6 +5764,7 @@
</span><span class="cx">                                 BC204EE711C83EAD008F3375 /* API */,
</span><span class="cx">                                 BC4BEE96120A091700FBA0C7 /* DOM */,
</span><span class="cx">                                 BC204EE411C83E9C008F3375 /* mac */,
</span><ins>+                                3769079C18F340A2001DFF04 /* APIInjectedBundleFormClient.h */,
</ins><span class="cx">                                 3769079818F31CB2001DFF04 /* APIInjectedBundlePageUIClient.h */,
</span><span class="cx">                                 BC204EE011C83E98008F3375 /* InjectedBundle.cpp */,
</span><span class="cx">                                 BC204EE111C83E98008F3375 /* InjectedBundle.h */,
</span><span class="lines">@@ -7260,6 +7263,7 @@
</span><span class="cx">                                 BCB9F6A51123DD0D00A137E0 /* WKFramePolicyListener.h in Headers */,
</span><span class="cx">                                 E1AEA22F14687BDB00804569 /* WKFullKeyboardAccessWatcher.h in Headers */,
</span><span class="cx">                                 CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */,
</span><ins>+                                3769079E18F340A2001DFF04 /* APIInjectedBundleFormClient.h in Headers */,
</ins><span class="cx">                                 1AB8A1F618400B9D00E9AE69 /* WKPageFindMatchesClient.h in Headers */,
</span><span class="cx">                                 BC54CC1212D674EE005C67B0 /* WKGeolocationManager.h in Headers */,
</span><span class="cx">                                 BC06F44E12DBDF3F002D78DE /* WKGeolocationPermissionRequest.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;APIURLRequest.h&quot;
</span><span class="cx"> #include &quot;InjectedBundleBackForwardList.h&quot;
</span><span class="cx"> #include &quot;InjectedBundleNodeHandle.h&quot;
</span><ins>+#include &quot;InjectedBundlePageFormClient.h&quot;
</ins><span class="cx"> #include &quot;InjectedBundlePageUIClient.h&quot;
</span><span class="cx"> #include &quot;PageBanner.h&quot;
</span><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><span class="lines">@@ -79,7 +80,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageSetFormClient(WKBundlePageRef pageRef, WKBundlePageFormClientBase* wkClient)
</span><span class="cx"> {
</span><del>-    toImpl(pageRef)-&gt;initializeInjectedBundleFormClient(wkClient);
</del><ins>+    toImpl(pageRef)-&gt;setInjectedBundleFormClient(std::make_unique&lt;InjectedBundlePageFormClient&gt;(wkClient));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageSetPageLoaderClient(WKBundlePageRef pageRef, WKBundlePageLoaderClientBase* wkClient)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePageFormClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define WKBundlePageFormClient_h
</span><span class="cx"> 
</span><span class="cx"> #include &lt;WebKit2/WKBase.h&gt;
</span><ins>+#include &lt;WebKit2/WKBundlePageEditorClient.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> typedef void (*WKBundlePageTextFieldDidBeginEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
</span><span class="cx"> typedef void (*WKBundlePageTextFieldDidEndEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx"> #import &quot;_WKRemoteObjectRegistryInternal.h&quot;
</span><span class="cx"> #import &lt;WebCore/Document.h&gt;
</span><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><ins>+#import &lt;WebCore/HTMLFormElement.h&gt;
+#import &lt;WebCore/HTMLInputElement.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebKit;
</span><span class="lines">@@ -267,37 +269,6 @@
</span><span class="cx">     page.initializeInjectedBundleResourceLoadClient(&amp;client.base);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void didFocusTextField(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandleRef, WKBundleFrameRef frameRef, const void* clientInfo)
-{
-    WKWebProcessPlugInBrowserContextController *controller = (WKWebProcessPlugInBrowserContextController *)clientInfo;
-    auto formDelegate = controller-&gt;_formDelegate.get();
-
-    if ([formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:didFocusTextField:inFrame:)])
-        [formDelegate _webProcessPlugInBrowserContextController:controller didFocusTextField:wrapper(*toImpl(htmlInputElementHandleRef)) inFrame:wrapper(*toImpl(frameRef))];
-}
-
-static void willSubmitForm(WKBundlePageRef page, WKBundleNodeHandleRef htmlFormElementHandle, WKBundleFrameRef frame, WKBundleFrameRef sourceFrame, WKDictionaryRef values, WKTypeRef* userData, const void* clientInfo)
-{
-    WKWebProcessPlugInBrowserContextController *controller = (WKWebProcessPlugInBrowserContextController *)clientInfo;
-    auto formDelegate = controller-&gt;_formDelegate.get();
-
-    if ([formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:willSubmitForm:toFrame:fromFrame:withValues:)])
-        [formDelegate _webProcessPlugInBrowserContextController:controller willSubmitForm:wrapper(*toImpl(htmlFormElementHandle)) toFrame:wrapper(*toImpl(frame)) fromFrame:wrapper(*toImpl(sourceFrame)) withValues:wrapper(*toImpl(values))];
-}
-
-static void setUpFormClient(WKWebProcessPlugInBrowserContextController *contextController, WebPage&amp; page)
-{
-    WKBundlePageFormClientV2 client;
-    memset(&amp;client, 0, sizeof(client));
-
-    client.base.version = 2;
-    client.base.clientInfo = contextController;
-    client.didFocusTextField = didFocusTextField;
-    client.willSubmitForm = willSubmitForm;
-
-    page.initializeInjectedBundleFormClient(&amp;client.base);
-}
-
</del><span class="cx"> - (id &lt;WKWebProcessPlugInLoadDelegate&gt;)loadDelegate
</span><span class="cx"> {
</span><span class="cx">     return _loadDelegate.getAutoreleased();
</span><span class="lines">@@ -404,10 +375,44 @@
</span><span class="cx"> {
</span><span class="cx">     _formDelegate = formDelegate;
</span><span class="cx"> 
</span><ins>+    class FormClient : public API::InjectedBundle::FormClient {
+    public:
+        explicit FormClient(WKWebProcessPlugInBrowserContextController *controller)
+            : m_controller(controller)
+        {
+        }
+
+        virtual ~FormClient() { }
+
+        virtual void didFocusTextField(WebPage*, HTMLInputElement* inputElement, WebFrame* frame) override
+        {
+            auto formDelegate = m_controller-&gt;_formDelegate.get();
+
+            if ([formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:didFocusTextField:inFrame:)])
+                [formDelegate _webProcessPlugInBrowserContextController:m_controller didFocusTextField:wrapper(*InjectedBundleNodeHandle::getOrCreate(inputElement).get()) inFrame:wrapper(*frame)];
+        }
+
+        virtual void willSubmitForm(WebPage*, HTMLFormElement* formElement, WebFrame* frame, WebFrame* sourceFrame, const Vector&lt;std::pair&lt;WTF::String, WTF::String&gt;&gt;&amp; values, RefPtr&lt;API::Object&gt;&amp; userData) override
+        {
+            auto formDelegate = m_controller-&gt;_formDelegate.get();
+
+            if ([formDelegate respondsToSelector:@selector(_webProcessPlugInBrowserContextController:willSubmitForm:toFrame:fromFrame:withValues:)]) {
+                auto valueMap = adoptNS([[NSMutableDictionary alloc] initWithCapacity:values.size()]);
+                for (const auto&amp; pair : values)
+                    [valueMap setObject:pair.second forKey:pair.first];
+
+                [formDelegate _webProcessPlugInBrowserContextController:m_controller willSubmitForm:wrapper(*InjectedBundleNodeHandle::getOrCreate(formElement).get()) toFrame:wrapper(*frame) fromFrame:wrapper(*sourceFrame) withValues:valueMap.get()];
+            }
+        }
+
+    private:
+        WKWebProcessPlugInBrowserContextController *m_controller;
+    };
+
</ins><span class="cx">     if (formDelegate)
</span><del>-        setUpFormClient(self, *_page);
</del><ins>+        _page-&gt;setInjectedBundleFormClient(std::make_unique&lt;FormClient&gt;(self));
</ins><span class="cx">     else
</span><del>-        _page-&gt;initializeInjectedBundleFormClient(nullptr);
</del><ins>+        _page-&gt;setInjectedBundleFormClient(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIInjectedBundleFormClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h (0 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/APIInjectedBundleFormClient.h        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef APIInjectedBundleFormClient_h
+#define APIInjectedBundleFormClient_h
+
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+class Element;
+class HTMLFormElement;
+class HTMLInputElement;
+class HTMLTextAreaElement;
+}
+
+namespace WebKit {
+class WebFrame;
+class WebPage;
+}
+
+namespace API {
+
+class Object;
+
+namespace InjectedBundle {
+
+class FormClient {
+public:
+    virtual ~FormClient() { }
+
+    virtual void didFocusTextField(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { }
+    virtual void textFieldDidBeginEditing(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { }
+    virtual void textFieldDidEndEditing(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { }
+    virtual void textDidChangeInTextField(WebKit::WebPage*, WebCore::HTMLInputElement*, WebKit::WebFrame*) { }
+    virtual void textDidChangeInTextArea(WebKit::WebPage*, WebCore::HTMLTextAreaElement*, WebKit::WebFrame*) { }
+
+    enum class InputFieldAction {
+        MoveUp,
+        MoveDown,
+        Cancel,
+        InsertTab,
+        InsertBacktab,
+        InsertNewline,
+        InsertDelete,
+    };
+
+    virtual bool shouldPerformActionInTextField(WebKit::WebPage*, WebCore::HTMLInputElement*, InputFieldAction, WebKit::WebFrame*) { return false; }
+    virtual void willSubmitForm(WebKit::WebPage*, WebCore::HTMLFormElement*, WebKit::WebFrame*, WebKit::WebFrame* sourceFrame, const Vector&lt;std::pair&lt;WTF::String, WTF::String&gt;&gt;&amp;, RefPtr&lt;API::Object&gt;&amp; userData) { UNUSED_PARAM(userData); }
+    virtual void willSendSubmitEvent(WebKit::WebPage*, WebCore::HTMLFormElement*, WebKit::WebFrame*, WebKit::WebFrame* sourceFrame, const Vector&lt;std::pair&lt;WTF::String, WTF::String&gt;&gt;&amp;) { }
+    virtual void didAssociateFormControls(WebKit::WebPage*, const Vector&lt;RefPtr&lt;WebCore::Element&gt;&gt;&amp;) { }
+    virtual bool shouldNotifyOnFormChanges(WebKit::WebPage*) { return false; }
+};
+
+} // namespace InjectedBundle
+
+} // namespace API
+
+#endif // APIInjectedBundleFormClient_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageFormClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -39,6 +39,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+InjectedBundlePageFormClient::InjectedBundlePageFormClient(const WKBundlePageFormClientBase* client)
+{
+    initialize(client);
+}
+
</ins><span class="cx"> void InjectedBundlePageFormClient::didFocusTextField(WebPage* page, HTMLInputElement* inputElement, WebFrame* frame)
</span><span class="cx"> {
</span><span class="cx">     if (!m_client.didFocusTextField)
</span><span class="lines">@@ -84,13 +89,36 @@
</span><span class="cx">     m_client.textDidChangeInTextArea(toAPI(page), toAPI(nodeHandle.get()), toAPI(frame), m_client.base.clientInfo);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool InjectedBundlePageFormClient::shouldPerformActionInTextField(WebPage* page, HTMLInputElement* inputElement, WKInputFieldActionType actionType, WebFrame* frame)
</del><ins>+static WKInputFieldActionType toWKInputFieldActionType(API::InjectedBundle::FormClient::InputFieldAction action)
</ins><span class="cx"> {
</span><ins>+    switch (action) {
+    case API::InjectedBundle::FormClient::InputFieldAction::MoveUp:
+        return WKInputFieldActionTypeMoveUp;
+    case API::InjectedBundle::FormClient::InputFieldAction::MoveDown:
+        return WKInputFieldActionTypeMoveDown;
+    case API::InjectedBundle::FormClient::InputFieldAction::Cancel:
+        return WKInputFieldActionTypeCancel;
+    case API::InjectedBundle::FormClient::InputFieldAction::InsertTab:
+        return WKInputFieldActionTypeInsertTab;
+    case API::InjectedBundle::FormClient::InputFieldAction::InsertBacktab:
+        return WKInputFieldActionTypeInsertBacktab;
+    case API::InjectedBundle::FormClient::InputFieldAction::InsertNewline:
+        return WKInputFieldActionTypeInsertNewline;
+    case API::InjectedBundle::FormClient::InputFieldAction::InsertDelete:
+        return WKInputFieldActionTypeInsertDelete;
+    }
+
+    ASSERT_NOT_REACHED();
+    return WKInputFieldActionTypeCancel;
+}
+
+bool InjectedBundlePageFormClient::shouldPerformActionInTextField(WebPage* page, HTMLInputElement* inputElement, API::InjectedBundle::FormClient::InputFieldAction actionType, WebFrame* frame)
+{
</ins><span class="cx">     if (!m_client.shouldPerformActionInTextField)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;InjectedBundleNodeHandle&gt; nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
</span><del>-    return m_client.shouldPerformActionInTextField(toAPI(page), toAPI(nodeHandle.get()), actionType, toAPI(frame), m_client.base.clientInfo);
</del><ins>+    return m_client.shouldPerformActionInTextField(toAPI(page), toAPI(nodeHandle.get()), toWKInputFieldActionType(actionType), toAPI(frame), m_client.base.clientInfo);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InjectedBundlePageFormClient::willSendSubmitEvent(WebPage* page, HTMLFormElement* formElement, WebFrame* frame, WebFrame* sourceFrame, const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp; values)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageFormClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -27,44 +27,32 @@
</span><span class="cx"> #define InjectedBundlePageFormClient_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIClient.h&quot;
</span><del>-#include &quot;WKBundlePage.h&quot;
-#include &lt;algorithm&gt;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/Vector.h&gt;
</del><ins>+#include &quot;APIInjectedBundleFormClient.h&quot;
+#include &quot;WKBundlePageFormClient.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace API {
</span><del>-class Object;
</del><span class="cx"> 
</span><span class="cx"> template&lt;&gt; struct ClientTraits&lt;WKBundlePageFormClientBase&gt; {
</span><span class="cx">     typedef std::tuple&lt;WKBundlePageFormClientV0, WKBundlePageFormClientV1, WKBundlePageFormClientV2&gt; Versions;
</span><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-namespace WebCore {
-class Element;
-class HTMLFormElement;
-class HTMLInputElement;
-class HTMLTextAreaElement;
-}
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class ImmutableDictionary;
-class WebFrame;
-class WebPage;
-
-class InjectedBundlePageFormClient : public API::Client&lt;WKBundlePageFormClientBase&gt; {
</del><ins>+class InjectedBundlePageFormClient : public API::Client&lt;WKBundlePageFormClientBase&gt;, public API::InjectedBundle::FormClient {
</ins><span class="cx"> public:
</span><del>-    void didFocusTextField(WebPage*, WebCore::HTMLInputElement*, WebFrame*);
-    void textFieldDidBeginEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*);
-    void textFieldDidEndEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*);
-    void textDidChangeInTextField(WebPage*, WebCore::HTMLInputElement*, WebFrame*);
-    void textDidChangeInTextArea(WebPage*, WebCore::HTMLTextAreaElement*, WebFrame*);
-    bool shouldPerformActionInTextField(WebPage*, WebCore::HTMLInputElement*, WKInputFieldActionType, WebFrame*);    
-    void willSubmitForm(WebPage*, WebCore::HTMLFormElement*, WebFrame*, WebFrame* sourceFrame, const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp;, RefPtr&lt;API::Object&gt;&amp; userData);
-    void willSendSubmitEvent(WebPage*, WebCore::HTMLFormElement*, WebFrame*, WebFrame* sourceFrame, const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp;);
-    void didAssociateFormControls(WebPage*, const Vector&lt;RefPtr&lt;WebCore::Element&gt;&gt;&amp;);
-    bool shouldNotifyOnFormChanges(WebPage*);
</del><ins>+    explicit InjectedBundlePageFormClient(const WKBundlePageFormClientBase*);
+
+    virtual void didFocusTextField(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override;
+    virtual void textFieldDidBeginEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override;
+    virtual void textFieldDidEndEditing(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override;
+    virtual void textDidChangeInTextField(WebPage*, WebCore::HTMLInputElement*, WebFrame*) override;
+    virtual void textDidChangeInTextArea(WebPage*, WebCore::HTMLTextAreaElement*, WebFrame*) override;
+    virtual bool shouldPerformActionInTextField(WebPage*, WebCore::HTMLInputElement*, InputFieldAction, WebFrame*) override;    
+    virtual void willSubmitForm(WebPage*, WebCore::HTMLFormElement*, WebFrame*, WebFrame* sourceFrame, const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp;, RefPtr&lt;API::Object&gt;&amp; userData) override;
+    virtual void willSendSubmitEvent(WebPage*, WebCore::HTMLFormElement*, WebFrame*, WebFrame* sourceFrame, const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp;) override;
+    virtual void didAssociateFormControls(WebPage*, const Vector&lt;RefPtr&lt;WebCore::Element&gt;&gt;&amp;) override;
+    virtual bool shouldNotifyOnFormChanges(WebPage*) override;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlePageUIClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -41,18 +41,8 @@
</span><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-namespace WebCore {
-class GraphicsContext;
-class HitTestResult;
-class IntRect;
-}
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class WebFrame;
-class WebPage;
-class WebSecurityOrigin;
-
</del><span class="cx"> class InjectedBundlePageUIClient : public API::Client&lt;WKBundlePageUIClientBase&gt;, public API::InjectedBundle::PageUIClient {
</span><span class="cx"> public:
</span><span class="cx">     explicit InjectedBundlePageUIClient(const WKBundlePageUIClientBase*);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebEditorClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -361,6 +361,29 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static API::InjectedBundle::FormClient::InputFieldAction toInputFieldAction(WKInputFieldActionType action)
+{
+    switch (action) {
+    case WKInputFieldActionTypeMoveUp:
+        return API::InjectedBundle::FormClient::InputFieldAction::MoveUp;
+    case WKInputFieldActionTypeMoveDown:
+        return API::InjectedBundle::FormClient::InputFieldAction::MoveDown;
+    case WKInputFieldActionTypeCancel:
+        return API::InjectedBundle::FormClient::InputFieldAction::Cancel;
+    case WKInputFieldActionTypeInsertTab:
+        return API::InjectedBundle::FormClient::InputFieldAction::InsertTab;
+    case WKInputFieldActionTypeInsertNewline:
+        return API::InjectedBundle::FormClient::InputFieldAction::InsertNewline;
+    case WKInputFieldActionTypeInsertDelete:
+        return API::InjectedBundle::FormClient::InputFieldAction::InsertDelete;
+    case WKInputFieldActionTypeInsertBacktab:
+        return API::InjectedBundle::FormClient::InputFieldAction::InsertBacktab;
+    }
+
+    ASSERT_NOT_REACHED();
+    return API::InjectedBundle::FormClient::InputFieldAction::Cancel;
+}
+
</ins><span class="cx"> bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event)
</span><span class="cx"> {
</span><span class="cx">     if (!isHTMLInputElement(element))
</span><span class="lines">@@ -373,7 +396,7 @@
</span><span class="cx">     WebFrame* webFrame = WebFrame::fromCoreFrame(*element-&gt;document().frame());
</span><span class="cx">     ASSERT(webFrame);
</span><span class="cx"> 
</span><del>-    return m_page-&gt;injectedBundleFormClient().shouldPerformActionInTextField(m_page, toHTMLInputElement(element), actionType, webFrame);
</del><ins>+    return m_page-&gt;injectedBundleFormClient().shouldPerformActionInTextField(m_page, toHTMLInputElement(element), toInputFieldAction(actionType), webFrame);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebEditorClient::textWillBeDeletedInTextField(Element* element)
</span><span class="lines">@@ -384,7 +407,7 @@
</span><span class="cx">     WebFrame* webFrame = WebFrame::fromCoreFrame(*element-&gt;document().frame());
</span><span class="cx">     ASSERT(webFrame);
</span><span class="cx"> 
</span><del>-    m_page-&gt;injectedBundleFormClient().shouldPerformActionInTextField(m_page, toHTMLInputElement(element), WKInputFieldActionTypeInsertDelete, webFrame);
</del><ins>+    m_page-&gt;injectedBundleFormClient().shouldPerformActionInTextField(m_page, toHTMLInputElement(element), toInputFieldAction(WKInputFieldActionTypeInsertDelete), webFrame);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebEditorClient::shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType type) const
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -263,6 +263,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     , m_setCanStartMediaTimer(RunLoop::main(), this, &amp;WebPage::setCanStartMediaTimerFired)
</span><span class="cx">     , m_sendDidUpdateViewStateTimer(RunLoop::main(), this, &amp;WebPage::didUpdateViewStateTimerFired)
</span><ins>+    , m_formClient(std::make_unique&lt;API::InjectedBundle::FormClient&gt;())
</ins><span class="cx">     , m_uiClient(std::make_unique&lt;API::InjectedBundle::PageUIClient&gt;())
</span><span class="cx">     , m_findController(this)
</span><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR)
</span><span class="lines">@@ -529,9 +530,14 @@
</span><span class="cx">     m_editorClient.initialize(client);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::initializeInjectedBundleFormClient(WKBundlePageFormClientBase* client)
</del><ins>+void WebPage::setInjectedBundleFormClient(std::unique_ptr&lt;API::InjectedBundle::FormClient&gt; formClient)
</ins><span class="cx"> {
</span><del>-    m_formClient.initialize(client);
</del><ins>+    if (!formClient) {
+        m_formClient = std::make_unique&lt;API::InjectedBundle::FormClient&gt;();
+        return;
+    }
+
+    m_formClient = std::move(formClient);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase* client)
</span><span class="lines">@@ -879,7 +885,7 @@
</span><span class="cx">     m_contextMenuClient.initialize(0);
</span><span class="cx"> #endif
</span><span class="cx">     m_editorClient.initialize(0);
</span><del>-    m_formClient.initialize(0);
</del><ins>+    m_formClient = std::unique_ptr&lt;API::InjectedBundle::FormClient&gt;();
</ins><span class="cx">     m_loaderClient.initialize(0);
</span><span class="cx">     m_policyClient.initialize(0);
</span><span class="cx">     m_resourceLoadClient.initialize(0);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (166889 => 166890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-04-07 22:21:58 UTC (rev 166889)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-04-07 23:00:04 UTC (rev 166890)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef WebPage_h
</span><span class="cx"> #define WebPage_h
</span><span class="cx"> 
</span><ins>+#include &quot;APIInjectedBundleFormClient.h&quot;
</ins><span class="cx"> #include &quot;APIInjectedBundlePageUIClient.h&quot;
</span><span class="cx"> #include &quot;APIObject.h&quot;
</span><span class="cx"> #include &quot;DrawingArea.h&quot;
</span><span class="lines">@@ -34,7 +35,6 @@
</span><span class="cx"> #include &quot;ImageOptions.h&quot;
</span><span class="cx"> #include &quot;InjectedBundlePageDiagnosticLoggingClient.h&quot;
</span><span class="cx"> #include &quot;InjectedBundlePageEditorClient.h&quot;
</span><del>-#include &quot;InjectedBundlePageFormClient.h&quot;
</del><span class="cx"> #include &quot;InjectedBundlePageFullScreenClient.h&quot;
</span><span class="cx"> #include &quot;InjectedBundlePageLoaderClient.h&quot;
</span><span class="cx"> #include &quot;InjectedBundlePagePolicyClient.h&quot;
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">     void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClientBase*);
</span><span class="cx"> #endif
</span><span class="cx">     void initializeInjectedBundleEditorClient(WKBundlePageEditorClientBase*);
</span><del>-    void initializeInjectedBundleFormClient(WKBundlePageFormClientBase*);
</del><ins>+    void setInjectedBundleFormClient(std::unique_ptr&lt;API::InjectedBundle::FormClient&gt;);
</ins><span class="cx">     void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase*);
</span><span class="cx">     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
</span><span class="cx">     void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
</span><span class="lines">@@ -295,7 +295,7 @@
</span><span class="cx">     InjectedBundlePageContextMenuClient&amp; injectedBundleContextMenuClient() { return m_contextMenuClient; }
</span><span class="cx"> #endif
</span><span class="cx">     InjectedBundlePageEditorClient&amp; injectedBundleEditorClient() { return m_editorClient; }
</span><del>-    InjectedBundlePageFormClient&amp; injectedBundleFormClient() { return m_formClient; }
</del><ins>+    API::InjectedBundle::FormClient&amp; injectedBundleFormClient() { return *m_formClient.get(); }
</ins><span class="cx">     InjectedBundlePageLoaderClient&amp; injectedBundleLoaderClient() { return m_loaderClient; }
</span><span class="cx">     InjectedBundlePagePolicyClient&amp; injectedBundlePolicyClient() { return m_policyClient; }
</span><span class="cx">     InjectedBundlePageResourceLoadClient&amp; injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
</span><span class="lines">@@ -1075,7 +1075,7 @@
</span><span class="cx">     InjectedBundlePageContextMenuClient m_contextMenuClient;
</span><span class="cx"> #endif
</span><span class="cx">     InjectedBundlePageEditorClient m_editorClient;
</span><del>-    InjectedBundlePageFormClient m_formClient;
</del><ins>+    std::unique_ptr&lt;API::InjectedBundle::FormClient&gt; m_formClient;
</ins><span class="cx">     InjectedBundlePageLoaderClient m_loaderClient;
</span><span class="cx">     InjectedBundlePagePolicyClient m_policyClient;
</span><span class="cx">     InjectedBundlePageResourceLoadClient m_resourceLoadClient;
</span></span></pre>
</div>
</div>

</body>
</html>