<!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>[170702] trunk</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/170702">170702</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-07-02 00:19:46 -0700 (Wed, 02 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] WebKitWebView::create should receive information about the navigation action
https://bugs.webkit.org/show_bug.cgi?id=133680

Reviewed by Martin Robinson.

Source/WebKit2:
Add WebKitNavigationAction boxed type representing a navigation
action to be passed as parameter of WebKitWebView::create
signal. In the future it could be also for the
WebKitNavigationPolicyDecision class. The class contains
information about a navigation action like the navigation type,
the request, the mouse button and key modifiers and whether it was
started by a user gesture. This information is needed to be able
to implement a proper popup blocker. Since all that information is
not provided by the C API, we have switched the UI client to use a
custom client derived from API::UIClient. This also avoids a lot
of toAPI -&gt; toImpl unneeded conversions.

* PlatformGTK.cmake: Add new files to compilation.
* UIProcess/API/gtk/WebKitHitTestResult.cpp:
(webkitHitTestResultCreate): Use a WebHitTestResult::Data const
reference instead of a pointer to a WebHitTestResult.
(webkitHitTestResultCompare): Ditto.
* UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
* UIProcess/API/gtk/WebKitNavigationAction.cpp: Added.
(webkitNavigationActionCreate): Create a WebKitNavigationAction
for the given ResourceRequest and NavigationActionData.
(webkit_navigation_action_copy):
(webkit_navigation_action_free):
(webkit_navigation_action_get_navigation_type):
(webkit_navigation_action_get_mouse_button):
(webkit_navigation_action_get_modifiers):
(webkit_navigation_action_get_request):
(webkit_navigation_action_is_user_gesture):
* UIProcess/API/gtk/WebKitNavigationAction.h: Added.
* UIProcess/API/gtk/WebKitNavigationActionPrivate.h: Added.
* UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
* UIProcess/API/gtk/WebKitPrivate.cpp:
(toGdkModifiers):
(toWebKitNavigationType):
(toWebKitMouseButton):
* UIProcess/API/gtk/WebKitPrivate.h:
* UIProcess/API/gtk/WebKitUIClient.cpp:
(UIClient::UIClient): Implement the UIClient using a custom class.
(attachUIClientToView): Set the UIClient directly to the WebPageProxy.
(createNewPage): Deleted.
(showPage): Deleted.
(closePage): Deleted.
(runJavaScriptAlert): Deleted.
(runJavaScriptConfirm): Deleted.
(runJavaScriptPrompt): Deleted.
(toolbarsAreVisible): Deleted.
(setToolbarsAreVisible): Deleted.
(menuBarIsVisible): Deleted.
(setMenuBarIsVisible): Deleted.
(statusBarIsVisible): Deleted.
(setStatusBarIsVisible): Deleted.
(isResizable): Deleted.
(setIsResizable): Deleted.
(getWindowFrame): Deleted.
(setWindowFrame): Deleted.
(mouseDidMoveOverElement): Deleted.
(printFrame): Deleted.
(runOpenPanel): Deleted.
(decidePolicyForGeolocationPermissionRequest): Deleted.
(runModal): Deleted.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewCreate): Add WebKitNavigationAction parameter.
(webkit_web_view_class_init): Add WebKitNavigationAction paramter
to CREATE signal.
(webkitWebViewCreateNewPage): Add WebKitNavigationAction parameter
and pass it to the signal callbacks.
(webkitWebViewMouseTargetChanged): Use a WebHitTestResult::Data
const reference.
(webkitWebViewPopulateContextMenu): Ditto.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitWindowProperties.cpp:
(webkitWindowPropertiesUpdateFromWebWindowFeatures): Use a
WebCore::WindowFeatures const reference.
* UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
* UIProcess/API/gtk/webkit2.h: Include WebKitNavigationAction.h.

Tools:
Add unit test to check the WebKitNavigationAction passed to
WebKitWebView::create callback.

* MiniBrowser/gtk/BrowserWindow.c:
(webViewCreate): Add WebKitNavigationAction parameter.
* TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
(testWebViewCreateNavigationData):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitPolicyClient.cpp:
(createCallback):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitHitTestResultcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitHitTestResultPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationPolicyDecisionh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitPrivatecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitUIClientcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWindowPropertiescpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWindowPropertiesPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkwebkit2h">trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsMiniBrowsergtkBrowserWindowc">trunk/Tools/MiniBrowser/gtk/BrowserWindow.c</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestMultiprocesscpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestPrintingcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestUIClientcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitPolicyClientcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitPolicyClient.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationActioncpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationActionh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationActionPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -1,3 +1,89 @@
</span><ins>+2014-07-02  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] WebKitWebView::create should receive information about the navigation action
+        https://bugs.webkit.org/show_bug.cgi?id=133680
+
+        Reviewed by Martin Robinson.
+
+        Add WebKitNavigationAction boxed type representing a navigation
+        action to be passed as parameter of WebKitWebView::create
+        signal. In the future it could be also for the
+        WebKitNavigationPolicyDecision class. The class contains
+        information about a navigation action like the navigation type,
+        the request, the mouse button and key modifiers and whether it was
+        started by a user gesture. This information is needed to be able
+        to implement a proper popup blocker. Since all that information is
+        not provided by the C API, we have switched the UI client to use a
+        custom client derived from API::UIClient. This also avoids a lot
+        of toAPI -&gt; toImpl unneeded conversions.
+
+        * PlatformGTK.cmake: Add new files to compilation.
+        * UIProcess/API/gtk/WebKitHitTestResult.cpp:
+        (webkitHitTestResultCreate): Use a WebHitTestResult::Data const
+        reference instead of a pointer to a WebHitTestResult.
+        (webkitHitTestResultCompare): Ditto.
+        * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
+        * UIProcess/API/gtk/WebKitNavigationAction.cpp: Added.
+        (webkitNavigationActionCreate): Create a WebKitNavigationAction
+        for the given ResourceRequest and NavigationActionData.
+        (webkit_navigation_action_copy):
+        (webkit_navigation_action_free):
+        (webkit_navigation_action_get_navigation_type):
+        (webkit_navigation_action_get_mouse_button):
+        (webkit_navigation_action_get_modifiers):
+        (webkit_navigation_action_get_request):
+        (webkit_navigation_action_is_user_gesture):
+        * UIProcess/API/gtk/WebKitNavigationAction.h: Added.
+        * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: Added.
+        * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
+        * UIProcess/API/gtk/WebKitPrivate.cpp:
+        (toGdkModifiers):
+        (toWebKitNavigationType):
+        (toWebKitMouseButton):
+        * UIProcess/API/gtk/WebKitPrivate.h:
+        * UIProcess/API/gtk/WebKitUIClient.cpp:
+        (UIClient::UIClient): Implement the UIClient using a custom class.
+        (attachUIClientToView): Set the UIClient directly to the WebPageProxy.
+        (createNewPage): Deleted.
+        (showPage): Deleted.
+        (closePage): Deleted.
+        (runJavaScriptAlert): Deleted.
+        (runJavaScriptConfirm): Deleted.
+        (runJavaScriptPrompt): Deleted.
+        (toolbarsAreVisible): Deleted.
+        (setToolbarsAreVisible): Deleted.
+        (menuBarIsVisible): Deleted.
+        (setMenuBarIsVisible): Deleted.
+        (statusBarIsVisible): Deleted.
+        (setStatusBarIsVisible): Deleted.
+        (isResizable): Deleted.
+        (setIsResizable): Deleted.
+        (getWindowFrame): Deleted.
+        (setWindowFrame): Deleted.
+        (mouseDidMoveOverElement): Deleted.
+        (printFrame): Deleted.
+        (runOpenPanel): Deleted.
+        (decidePolicyForGeolocationPermissionRequest): Deleted.
+        (runModal): Deleted.
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkitWebViewCreate): Add WebKitNavigationAction parameter.
+        (webkit_web_view_class_init): Add WebKitNavigationAction paramter
+        to CREATE signal.
+        (webkitWebViewCreateNewPage): Add WebKitNavigationAction parameter
+        and pass it to the signal callbacks.
+        (webkitWebViewMouseTargetChanged): Use a WebHitTestResult::Data
+        const reference.
+        (webkitWebViewPopulateContextMenu): Ditto.
+        * UIProcess/API/gtk/WebKitWebView.h:
+        * UIProcess/API/gtk/WebKitWebViewPrivate.h:
+        * UIProcess/API/gtk/WebKitWindowProperties.cpp:
+        (webkitWindowPropertiesUpdateFromWebWindowFeatures): Use a
+        WebCore::WindowFeatures const reference.
+        * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
+        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
+        * UIProcess/API/gtk/webkit2.h: Include WebKitNavigationAction.h.
+
</ins><span class="cx"> 2014-07-01  KwangHyuk Kim  &lt;hyuki.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Fix occurrence of two cursors on WK2 EFL.
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -162,6 +162,9 @@
</span><span class="cx">     UIProcess/API/gtk/WebKitMimeInfo.cpp
</span><span class="cx">     UIProcess/API/gtk/WebKitMimeInfo.h
</span><span class="cx">     UIProcess/API/gtk/WebKitMimeInfoPrivate.h
</span><ins>+    UIProcess/API/gtk/WebKitNavigationAction.cpp
+    UIProcess/API/gtk/WebKitNavigationAction.h
+    UIProcess/API/gtk/WebKitNavigationActionPrivate.h
</ins><span class="cx">     UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
</span><span class="cx">     UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
</span><span class="cx">     UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
</span><span class="lines">@@ -337,6 +340,7 @@
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitJavascriptResult.h
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitMimeInfo.h
</span><ins>+    ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationAction.h
</ins><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPermissionRequest.h
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPlugin.h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -221,39 +221,33 @@
</span><span class="cx">                                                         paramFlags));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebKitHitTestResult* webkitHitTestResultCreate(WebHitTestResult* hitTestResult)
</del><ins>+WebKitHitTestResult* webkitHitTestResultCreate(const WebHitTestResult::Data&amp; hitTestResult)
</ins><span class="cx"> {
</span><span class="cx">     unsigned context = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
</span><span class="cx"> 
</span><del>-    const String&amp; linkURL = hitTestResult-&gt;absoluteLinkURL();
-    if (!linkURL.isEmpty())
</del><ins>+    if (!hitTestResult.absoluteLinkURL.isEmpty())
</ins><span class="cx">         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;
</span><span class="cx"> 
</span><del>-    const String&amp; imageURL = hitTestResult-&gt;absoluteImageURL();
-    if (!imageURL.isEmpty())
</del><ins>+    if (!hitTestResult.absoluteImageURL.isEmpty())
</ins><span class="cx">         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
</span><span class="cx"> 
</span><del>-    const String&amp; mediaURL = hitTestResult-&gt;absoluteMediaURL();
-    if (!mediaURL.isEmpty())
</del><ins>+    if (!hitTestResult.absoluteMediaURL.isEmpty())
</ins><span class="cx">         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;
</span><span class="cx"> 
</span><del>-    if (hitTestResult-&gt;isContentEditable())
</del><ins>+    if (hitTestResult.isContentEditable)
</ins><span class="cx">         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
</span><span class="cx"> 
</span><del>-    if (hitTestResult-&gt;isScrollbar())
</del><ins>+    if (hitTestResult.isScrollbar)
</ins><span class="cx">         context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR;
</span><span class="cx"> 
</span><del>-    const String&amp; linkTitle = hitTestResult-&gt;linkTitle();
-    const String&amp; linkLabel = hitTestResult-&gt;linkLabel();
-
</del><span class="cx">     return WEBKIT_HIT_TEST_RESULT(g_object_new(WEBKIT_TYPE_HIT_TEST_RESULT,
</span><del>-                                               &quot;context&quot;, context,
-                                               &quot;link-uri&quot;, !linkURL.isEmpty() ? linkURL.utf8().data() : 0,
-                                               &quot;image-uri&quot;, !imageURL.isEmpty() ? imageURL.utf8().data() : 0,
-                                               &quot;media-uri&quot;, !mediaURL.isEmpty() ? mediaURL.utf8().data() : 0,
-                                               &quot;link-title&quot;, !linkTitle.isEmpty() ? linkTitle.utf8().data() : 0,
-                                               &quot;link-label&quot;, !linkLabel.isEmpty() ? linkLabel.utf8().data() : 0,
-                                               NULL));
</del><ins>+        &quot;context&quot;, context,
+        &quot;link-uri&quot;, context &amp; WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK ? hitTestResult.absoluteLinkURL.utf8().data() : nullptr,
+        &quot;image-uri&quot;, context &amp; WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE ? hitTestResult.absoluteImageURL.utf8().data() : nullptr,
+        &quot;media-uri&quot;, context &amp; WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA ? hitTestResult.absoluteMediaURL.utf8().data() : nullptr,
+        &quot;link-title&quot;, !hitTestResult.linkTitle.isEmpty() ? hitTestResult.linkTitle.utf8().data() : nullptr,
+        &quot;link-label&quot;, !hitTestResult.linkLabel.isEmpty() ? hitTestResult.linkLabel.utf8().data() : nullptr,
+        nullptr));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool stringIsEqualToCString(const String&amp; string, const CString&amp; cString)
</span><span class="lines">@@ -261,16 +255,16 @@
</span><span class="cx">     return ((string.isEmpty() &amp;&amp; cString.isNull()) || (string.utf8() == cString));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool webkitHitTestResultCompare(WebKitHitTestResult* hitTestResult, WebHitTestResult* webHitTestResult)
</del><ins>+bool webkitHitTestResultCompare(WebKitHitTestResult* hitTestResult, const WebHitTestResult::Data&amp; webHitTestResult)
</ins><span class="cx"> {
</span><span class="cx">     WebKitHitTestResultPrivate* priv = hitTestResult-&gt;priv;
</span><del>-    return webHitTestResult-&gt;isContentEditable() == webkit_hit_test_result_context_is_editable(hitTestResult)
-        &amp;&amp; webHitTestResult-&gt;isScrollbar() == webkit_hit_test_result_context_is_scrollbar(hitTestResult)
-        &amp;&amp; stringIsEqualToCString(webHitTestResult-&gt;absoluteLinkURL(), priv-&gt;linkURI)
-        &amp;&amp; stringIsEqualToCString(webHitTestResult-&gt;linkTitle(), priv-&gt;linkTitle)
-        &amp;&amp; stringIsEqualToCString(webHitTestResult-&gt;linkLabel(), priv-&gt;linkLabel)
-        &amp;&amp; stringIsEqualToCString(webHitTestResult-&gt;absoluteImageURL(), priv-&gt;imageURI)
-        &amp;&amp; stringIsEqualToCString(webHitTestResult-&gt;absoluteMediaURL(), priv-&gt;mediaURI);
</del><ins>+    return webHitTestResult.isContentEditable == webkit_hit_test_result_context_is_editable(hitTestResult)
+        &amp;&amp; webHitTestResult.isScrollbar == webkit_hit_test_result_context_is_scrollbar(hitTestResult)
+        &amp;&amp; stringIsEqualToCString(webHitTestResult.absoluteLinkURL, priv-&gt;linkURI)
+        &amp;&amp; stringIsEqualToCString(webHitTestResult.linkTitle, priv-&gt;linkTitle)
+        &amp;&amp; stringIsEqualToCString(webHitTestResult.linkLabel, priv-&gt;linkLabel)
+        &amp;&amp; stringIsEqualToCString(webHitTestResult.absoluteImageURL, priv-&gt;imageURI)
+        &amp;&amp; stringIsEqualToCString(webHitTestResult.absoluteMediaURL, priv-&gt;mediaURI);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitHitTestResultPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> #include &quot;WebKitHitTestResult.h&quot;
</span><span class="cx"> #include &quot;WebKitPrivate.h&quot;
</span><span class="cx"> 
</span><del>-WebKitHitTestResult* webkitHitTestResultCreate(WebKit::WebHitTestResult*);
-bool webkitHitTestResultCompare(WebKitHitTestResult*, WebKit::WebHitTestResult*);
</del><ins>+WebKitHitTestResult* webkitHitTestResultCreate(const WebKit::WebHitTestResult::Data&amp;);
+bool webkitHitTestResultCompare(WebKitHitTestResult*, const WebKit::WebHitTestResult::Data&amp;);
</ins><span class="cx"> 
</span><span class="cx"> #endif // WebKitHitTestResultPrivate_h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationActioncpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp (0 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+/*
+ * Copyright (C) 2014 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitNavigationAction.h&quot;
+
+#include &quot;WebKitNavigationActionPrivate.h&quot;
+#include &lt;gdk/gdk.h&gt;
+#include &lt;wtf/gobject/GRefPtr.h&gt;
+
+using namespace WebKit;
+
+G_DEFINE_BOXED_TYPE(WebKitNavigationAction, webkit_navigation_action, webkit_navigation_action_copy, webkit_navigation_action_free)
+
+WebKitNavigationAction* webkitNavigationActionCreate(WebKitURIRequest* request, const NavigationActionData&amp; navigationActionData)
+{
+    WebKitNavigationAction* navigation = g_slice_new0(WebKitNavigationAction);
+    new (navigation) WebKitNavigationAction(request, navigationActionData);
+    return navigation;
+}
+
+/**
+ * webkit_navigation_action_copy:
+ * @navigation: a #WebKitNavigationAction
+ *
+ * Make a copy of @navigation.
+ *
+ * Returns: (transfer full): A copy of passed in #WebKitNavigationAction
+ *
+ * Since: 2.6
+ */
+WebKitNavigationAction* webkit_navigation_action_copy(WebKitNavigationAction* navigation)
+{
+    g_return_val_if_fail(navigation, nullptr);
+
+    WebKitNavigationAction* copy = g_slice_new0(WebKitNavigationAction);
+    new (copy) WebKitNavigationAction(navigation);
+    return copy;
+}
+
+/**
+ * webkit_navigation_action_free:
+ * @navigation: a #WebKitNavigationAction
+ *
+ * Free the #WebKitNavigationAction
+ *
+ * Since: 2.6
+ */
+void webkit_navigation_action_free(WebKitNavigationAction* navigation)
+{
+    g_return_if_fail(navigation);
+
+    navigation-&gt;~WebKitNavigationAction();
+    g_slice_free(WebKitNavigationAction, navigation);
+}
+
+/**
+ * webkit_navigation_action_get_navigation_type:
+ * @navigation: a #WebKitNavigationAction
+ *
+ * Rtuen the type of action that triggered the navigation.
+ *
+ * Returns: a #WebKitNavigationType
+ *
+ * Since: 2.6
+ */
+WebKitNavigationType webkit_navigation_action_get_navigation_type(WebKitNavigationAction* navigation)
+{
+    g_return_val_if_fail(navigation, WEBKIT_NAVIGATION_TYPE_OTHER);
+    return navigation-&gt;type;
+}
+
+/**
+ * webkit_navigation_action_get_mouse_button:
+ * @navigation: a #WebKitNavigationAction
+ *
+ * Return the number of the mouse button that triggered the navigation, or 0 if
+ * the navigation was not started by a mouse event.
+ *
+ * Returns: the mouse button number or 0
+ *
+ * Since: 2.6
+ */
+unsigned webkit_navigation_action_get_mouse_button(WebKitNavigationAction* navigation)
+{
+    g_return_val_if_fail(navigation, 0);
+    return navigation-&gt;mouseButton;
+}
+
+/**
+ * webkit_navigation_action_get_modifiers:
+ * @navigation: a #WebKitNavigationAction
+ *
+ * Return a bitmask of #GdkModifierType values describing the modifier keys that were in effect
+ * when the navigation was requested
+ *
+ * Returns: the modifier keys
+ *
+ * Since: 2.6
+ */
+unsigned webkit_navigation_action_get_modifiers(WebKitNavigationAction* navigation)
+{
+    g_return_val_if_fail(navigation, 0);
+    return navigation-&gt;modifiers;
+}
+
+/**
+ * webkit_navigation_action_get_request:
+ * @navigation: a #WebKitNavigationAction
+ *
+ * Return the navigation #WebKitURIRequest
+ *
+ * Returns: (transfer none): a #WebKitURIRequest
+ *
+ * Since: 2.6
+ */
+WebKitURIRequest* webkit_navigation_action_get_request(WebKitNavigationAction* navigation)
+{
+    g_return_val_if_fail(navigation, nullptr);
+    return navigation-&gt;request.get();
+}
+
+/**
+ * webkit_navigation_action_is_user_gesture:
+ * @navigation: a #WebKitNavigationAction
+ *
+ * Return whether the navigation was triggered by a user gesture like a mouse click.
+ *
+ * Returns: whether navigation action is a user gesture
+ *
+ * Since: 2.6
+ */
+gboolean webkit_navigation_action_is_user_gesture(WebKitNavigationAction* navigation)
+{
+    g_return_val_if_fail(navigation, FALSE);
+    return navigation-&gt;isUserGesture;
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationActionh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.h (0 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2014 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) &amp;&amp; !defined(WEBKIT2_COMPILATION)
+#error &quot;Only &lt;webkit2/webkit2.h&gt; can be included directly.&quot;
+#endif
+
+#ifndef WebKitNavigationAction_h
+#define WebKitNavigationAction_h
+
+#include &lt;glib-object.h&gt;
+#include &lt;webkit2/WebKitDefines.h&gt;
+#include &lt;webkit2/WebKitURIRequest.h&gt;
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_NAVIGATION_ACTION (webkit_navigation_action_get_type())
+
+/**
+ * WebKitNavigationType:
+ * @WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: The navigation was triggered by clicking a link.
+ * @WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: The navigation was triggered by submitting a form.
+ * @WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: The navigation was triggered by navigating forward or backward.
+ * @WEBKIT_NAVIGATION_TYPE_RELOAD: The navigation was triggered by reloading.
+ * @WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: The navigation was triggered by resubmitting a form.
+ * @WEBKIT_NAVIGATION_TYPE_OTHER: The navigation was triggered by some other action.
+ *
+ * Enum values used to denote the various navigation types.
+ */
+typedef enum {
+    WEBKIT_NAVIGATION_TYPE_LINK_CLICKED,
+    WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED,
+    WEBKIT_NAVIGATION_TYPE_BACK_FORWARD,
+    WEBKIT_NAVIGATION_TYPE_RELOAD,
+    WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED,
+    WEBKIT_NAVIGATION_TYPE_OTHER
+} WebKitNavigationType;
+
+typedef struct _WebKitNavigationAction WebKitNavigationAction;
+
+
+WEBKIT_API GType
+webkit_navigation_action_get_type            (void);
+
+WEBKIT_API WebKitNavigationAction *
+webkit_navigation_action_copy                (WebKitNavigationAction *navigation);
+
+WEBKIT_API void
+webkit_navigation_action_free                (WebKitNavigationAction *navigation);
+
+WEBKIT_API WebKitNavigationType
+webkit_navigation_action_get_navigation_type (WebKitNavigationAction *navigation);
+
+WEBKIT_API guint
+webkit_navigation_action_get_mouse_button    (WebKitNavigationAction *navigation);
+
+WEBKIT_API guint
+webkit_navigation_action_get_modifiers       (WebKitNavigationAction *navigation);
+
+WEBKIT_API WebKitURIRequest *
+webkit_navigation_action_get_request         (WebKitNavigationAction *navigation);
+
+WEBKIT_API gboolean
+webkit_navigation_action_is_user_gesture     (WebKitNavigationAction *navigation);
+
+G_END_DECLS
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationActionPrivateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h (0 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2014 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitNavigationActionPrivate_h
+#define WebKitNavigationActionPrivate_h
+
+#include &quot;NavigationActionData.h&quot;
+#include &quot;WebKitNavigationAction.h&quot;
+#include &quot;WebKitPrivate.h&quot;
+
+struct _WebKitNavigationAction {
+    _WebKitNavigationAction(WebKitURIRequest* uriRequest, const WebKit::NavigationActionData&amp; navigationActionData)
+        : type(toWebKitNavigationType(navigationActionData.navigationType))
+        , mouseButton(toWebKitMouseButton(navigationActionData.mouseButton))
+        , modifiers(toGdkModifiers(navigationActionData.modifiers))
+        , isUserGesture(navigationActionData.isProcessingUserGesture)
+        , request(uriRequest)
+    {
+    }
+
+    _WebKitNavigationAction(WebKitNavigationAction* navigation)
+        : type(navigation-&gt;type)
+        , mouseButton(navigation-&gt;mouseButton)
+        , modifiers(navigation-&gt;modifiers)
+        , isUserGesture(navigation-&gt;isUserGesture)
+        , request(navigation-&gt;request)
+    {
+    }
+
+    WebKitNavigationType type;
+    unsigned mouseButton;
+    unsigned modifiers;
+    bool isUserGesture : 1;
+    GRefPtr&lt;WebKitURIRequest&gt; request;
+};
+
+WebKitNavigationAction* webkitNavigationActionCreate(WebKitURIRequest*, const WebKit::NavigationActionData&amp;);
+
+#endif // WebKitNavigationActionPrivate_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNavigationPolicyDecisionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -26,31 +26,12 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;glib-object.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitDefines.h&gt;
</span><ins>+#include &lt;webkit2/WebKitNavigationAction.h&gt;
</ins><span class="cx"> #include &lt;webkit2/WebKitPolicyDecision.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitURIRequest.h&gt;
</span><span class="cx"> 
</span><span class="cx"> G_BEGIN_DECLS
</span><span class="cx"> 
</span><del>-/**
- * WebKitNavigationType:
- * @WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: The navigation was triggered by clicking a link.
- * @WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: The navigation was triggered by submitting a form.
- * @WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: The navigation was triggered by navigating forward or backward.
- * @WEBKIT_NAVIGATION_TYPE_RELOAD: The navigation was triggered by reloading.
- * @WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: The navigation was triggered by resubmitting a form.
- * @WEBKIT_NAVIGATION_TYPE_OTHER: The navigation was triggered by some other action.
- *
- * Enum values used to denote the various navigation types.
- */
-typedef enum {
-    WEBKIT_NAVIGATION_TYPE_LINK_CLICKED,
-    WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED,
-    WEBKIT_NAVIGATION_TYPE_BACK_FORWARD,
-    WEBKIT_NAVIGATION_TYPE_RELOAD,
-    WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED,
-    WEBKIT_NAVIGATION_TYPE_OTHER,
-} WebKitNavigationType;
-
</del><span class="cx"> #define WEBKIT_TYPE_NAVIGATION_POLICY_DECISION            (webkit_navigation_policy_decision_get_type())
</span><span class="cx"> #define WEBKIT_NAVIGATION_POLICY_DECISION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_NAVIGATION_POLICY_DECISION, WebKitNavigationPolicyDecision))
</span><span class="cx"> #define WEBKIT_NAVIGATION_POLICY_DECISION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_NAVIGATION_POLICY_DECISION, WebKitNavigationPolicyDecisionClass))
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> #include &quot;WebKitPrivate.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ErrorsGtk.h&quot;
</span><ins>+#include &quot;WebEvent.h&quot;
</ins><span class="cx"> #include &quot;WebKitError.h&quot;
</span><span class="cx"> #include &lt;gdk/gdk.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -38,6 +39,57 @@
</span><span class="cx">     return modifiers;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned toGdkModifiers(WebKit::WebEvent::Modifiers wkModifiers)
+{
+    unsigned modifiers = 0;
+    if (wkModifiers &amp; WebKit::WebEvent::Modifiers::ShiftKey)
+        modifiers |= GDK_SHIFT_MASK;
+    if (wkModifiers &amp; WebKit::WebEvent::Modifiers::ControlKey)
+        modifiers |= GDK_CONTROL_MASK;
+    if (wkModifiers &amp; WebKit::WebEvent::Modifiers::AltKey)
+        modifiers |= GDK_MOD1_MASK;
+    if (wkModifiers &amp; WebKit::WebEvent::Modifiers::MetaKey)
+        modifiers |= GDK_META_MASK;
+    return modifiers;
+}
+
+WebKitNavigationType toWebKitNavigationType(WebCore::NavigationType type)
+{
+    switch (type) {
+    case WebCore::NavigationType::NavigationTypeLinkClicked:
+        return WEBKIT_NAVIGATION_TYPE_LINK_CLICKED;
+    case WebCore::NavigationType::NavigationTypeFormSubmitted:
+        return WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED;
+    case WebCore::NavigationType::NavigationTypeBackForward:
+        return WEBKIT_NAVIGATION_TYPE_BACK_FORWARD;
+    case WebCore::NavigationType::NavigationTypeReload:
+        return WEBKIT_NAVIGATION_TYPE_RELOAD;
+    case WebCore::NavigationType::NavigationTypeFormResubmitted:
+        return WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED;
+    case WebCore::NavigationType::NavigationTypeOther:
+        return WEBKIT_NAVIGATION_TYPE_OTHER;
+    default:
+        ASSERT_NOT_REACHED();
+        return WEBKIT_NAVIGATION_TYPE_OTHER;
+    }
+}
+
+unsigned toWebKitMouseButton(WebKit::WebMouseEvent::Button button)
+{
+    switch (button) {
+    case WebKit::WebMouseEvent::Button::NoButton:
+        return 0;
+    case WebKit::WebMouseEvent::Button::LeftButton:
+        return 1;
+    case WebKit::WebMouseEvent::Button::MiddleButton:
+        return 2;
+    case WebKit::WebMouseEvent::Button::RightButton:
+        return 3;
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
</ins><span class="cx"> unsigned wkEventMouseButtonToWebKitMouseButton(WKEventMouseButton wkButton)
</span><span class="cx"> {
</span><span class="cx">     switch (wkButton) {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef WebKitPrivate_h
</span><span class="cx"> #define WebKitPrivate_h
</span><span class="cx"> 
</span><ins>+#include &quot;WebKitNavigationAction.h&quot;
</ins><span class="cx"> #include &lt;WebKit/WKAPICast.h&gt;
</span><span class="cx"> #include &lt;WebKit/WKDownload.h&gt;
</span><span class="cx"> #include &lt;WebKit/WKFindOptions.h&gt;
</span><span class="lines">@@ -115,6 +116,9 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned wkEventModifiersToGdkModifiers(WKEventModifiers);
</span><span class="cx"> unsigned wkEventMouseButtonToWebKitMouseButton(WKEventMouseButton);
</span><ins>+unsigned toGdkModifiers(WebKit::WebEvent::Modifiers);
+WebKitNavigationType toWebKitNavigationType(WebCore::NavigationType);
+unsigned toWebKitMouseButton(WebKit::WebMouseEvent::Button);
</ins><span class="cx"> unsigned toWebKitError(unsigned webCoreError);
</span><span class="cx"> unsigned toWebCoreError(unsigned webKitError);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitUIClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -20,9 +20,12 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebKitUIClient.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;APIUIClient.h&quot;
</ins><span class="cx"> #include &quot;WebKitFileChooserRequestPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitGeolocationPermissionRequestPrivate.h&quot;
</span><ins>+#include &quot;WebKitNavigationActionPrivate.h&quot;
</ins><span class="cx"> #include &quot;WebKitPrivate.h&quot;
</span><ins>+#include &quot;WebKitURIRequestPrivate.h&quot;
</ins><span class="cx"> #include &quot;WebKitWebViewBasePrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitWebViewPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitWindowPropertiesPrivate.h&quot;
</span><span class="lines">@@ -32,187 +35,147 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><del>-static WKPageRef createNewPage(WKPageRef, WKURLRequestRef, WKDictionaryRef wkWindowFeatures, WKEventModifiers, WKEventMouseButton, const void* clientInfo)
-{
-    return static_cast&lt;WKPageRef&gt;(toAPI(webkitWebViewCreateNewPage(WEBKIT_WEB_VIEW(clientInfo), toImpl(wkWindowFeatures))));
-}
</del><ins>+class UIClient : public API::UIClient {
+public:
+    explicit UIClient(WebKitWebView* webView)
+        : m_webView(webView)
+    {
+    }
</ins><span class="cx"> 
</span><del>-static void showPage(WKPageRef, const void* clientInfo)
-{
-    webkitWebViewReadyToShowPage(WEBKIT_WEB_VIEW(clientInfo));
-}
</del><ins>+private:
+    virtual PassRefPtr&lt;WebPageProxy&gt; createNewPage(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceRequest&amp; resourceRequest, const WebCore::WindowFeatures&amp; windowFeatures, const NavigationActionData&amp; navigationActionData) override
+    {
+        GRefPtr&lt;WebKitURIRequest&gt; request = adoptGRef(webkitURIRequestCreateForResourceRequest(resourceRequest));
+        WebKitNavigationAction navigationAction(request.get(), navigationActionData);
+        return webkitWebViewCreateNewPage(m_webView, windowFeatures, &amp;navigationAction);
+    }
</ins><span class="cx"> 
</span><del>-static void closePage(WKPageRef, const void* clientInfo)
-{
-    webkitWebViewClosePage(WEBKIT_WEB_VIEW(clientInfo));
-}
</del><ins>+    virtual void showPage(WebPageProxy*) override
+    {
+        webkitWebViewReadyToShowPage(m_webView);
+    }
</ins><span class="cx"> 
</span><del>-static void runJavaScriptAlert(WKPageRef, WKStringRef message, WKFrameRef, const void* clientInfo)
-{
-    webkitWebViewRunJavaScriptAlert(WEBKIT_WEB_VIEW(clientInfo), toImpl(message)-&gt;string().utf8());
-}
</del><ins>+    virtual void close(WebPageProxy*) override
+    {
+        webkitWebViewClosePage(m_webView);
+    }
</ins><span class="cx"> 
</span><del>-static bool runJavaScriptConfirm(WKPageRef, WKStringRef message, WKFrameRef, const void* clientInfo)
-{
-    return webkitWebViewRunJavaScriptConfirm(WEBKIT_WEB_VIEW(clientInfo), toImpl(message)-&gt;string().utf8());
-}
</del><ins>+    virtual void runJavaScriptAlert(WebPageProxy*, const String&amp; message, WebFrameProxy*, std::function&lt;void ()&gt; completionHandler) override
+    {
+        webkitWebViewRunJavaScriptAlert(m_webView, message.utf8());
+        completionHandler();
+    }
</ins><span class="cx"> 
</span><del>-static WKStringRef runJavaScriptPrompt(WKPageRef, WKStringRef message, WKStringRef defaultValue, WKFrameRef, const void* clientInfo)
-{
-    CString result = webkitWebViewRunJavaScriptPrompt(WEBKIT_WEB_VIEW(clientInfo), toImpl(message)-&gt;string().utf8(),
-                                                      toImpl(defaultValue)-&gt;string().utf8());
-    return WKStringCreateWithUTF8CString(result.data());
-}
</del><ins>+    virtual void runJavaScriptConfirm(WebPageProxy*, const String&amp; message, WebFrameProxy*, std::function&lt;void (bool)&gt; completionHandler) override
+    {
+        completionHandler(webkitWebViewRunJavaScriptConfirm(m_webView, message.utf8()));
+    }
</ins><span class="cx"> 
</span><del>-static bool toolbarsAreVisible(WKPageRef, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    return webkit_window_properties_get_toolbar_visible(windowProperties);
-}
</del><ins>+    virtual void runJavaScriptPrompt(WebPageProxy*, const String&amp; message, const String&amp; defaultValue, WebFrameProxy*, std::function&lt;void (const String&amp;)&gt; completionHandler) override
+    {
+        CString result = webkitWebViewRunJavaScriptPrompt(m_webView, message.utf8(), defaultValue.utf8());
+        if (result.isNull()) {
+            completionHandler(String());
+            return;
+        }
</ins><span class="cx"> 
</span><del>-static void setToolbarsAreVisible(WKPageRef, bool toolbarsVisible, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    webkitWindowPropertiesSetToolbarVisible(windowProperties, toolbarsVisible);
-}
</del><ins>+        completionHandler(String::fromUTF8(result.data()));
+    }
</ins><span class="cx"> 
</span><del>-static bool menuBarIsVisible(WKPageRef, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    return webkit_window_properties_get_menubar_visible(windowProperties);
-}
</del><ins>+    virtual void mouseDidMoveOverElement(WebPageProxy*, const WebHitTestResult::Data&amp; data, WebEvent::Modifiers modifiers, API::Object*) override
+    {
+        webkitWebViewMouseTargetChanged(m_webView, data, toGdkModifiers(modifiers));
+    }
</ins><span class="cx"> 
</span><del>-static void setMenuBarIsVisible(WKPageRef, bool menuBarVisible, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    webkitWindowPropertiesSetMenubarVisible(windowProperties, menuBarVisible);
-}
</del><ins>+    virtual bool toolbarsAreVisible(WebPageProxy*) override
+    {
+        return webkit_window_properties_get_toolbar_visible(webkit_web_view_get_window_properties(m_webView));
+    }
</ins><span class="cx"> 
</span><del>-static bool statusBarIsVisible(WKPageRef, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    return webkit_window_properties_get_statusbar_visible(windowProperties);
-}
</del><ins>+    virtual void setToolbarsAreVisible(WebPageProxy*, bool visible) override
+    {
+        webkitWindowPropertiesSetToolbarVisible(webkit_web_view_get_window_properties(m_webView), visible);
+    }
</ins><span class="cx"> 
</span><del>-static void setStatusBarIsVisible(WKPageRef, bool statusBarVisible, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    webkitWindowPropertiesSetStatusbarVisible(windowProperties, statusBarVisible);
-}
</del><ins>+    virtual bool menuBarIsVisible(WebPageProxy*) override
+    {
+        return webkit_window_properties_get_menubar_visible(webkit_web_view_get_window_properties(m_webView));
+    }
</ins><span class="cx"> 
</span><del>-static bool isResizable(WKPageRef, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    return webkit_window_properties_get_resizable(windowProperties);
-}
</del><ins>+    virtual void setMenuBarIsVisible(WebPageProxy*, bool visible) override
+    {
+        webkitWindowPropertiesSetToolbarVisible(webkit_web_view_get_window_properties(m_webView), visible);
+    }
</ins><span class="cx"> 
</span><del>-static void setIsResizable(WKPageRef, bool resizable, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    webkitWindowPropertiesSetResizable(windowProperties, resizable);
-}
</del><ins>+    virtual bool statusBarIsVisible(WebPageProxy*) override
+    {
+        return webkit_window_properties_get_statusbar_visible(webkit_web_view_get_window_properties(m_webView));
+    }
</ins><span class="cx"> 
</span><del>-static WKRect getWindowFrame(WKPageRef, const void* clientInfo)
-{
-    GdkRectangle geometry = { 0, 0, 0, 0 };
-    GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(clientInfo));
-    if (WebCore::widgetIsOnscreenToplevelWindow(window) &amp;&amp; gtk_widget_get_visible(window)) {
-        gtk_window_get_position(GTK_WINDOW(window), &amp;geometry.x, &amp;geometry.y);
-        gtk_window_get_size(GTK_WINDOW(window), &amp;geometry.width, &amp;geometry.height);
</del><ins>+    virtual void setStatusBarIsVisible(WebPageProxy*, bool visible) override
+    {
+        webkitWindowPropertiesSetStatusbarVisible(webkit_web_view_get_window_properties(m_webView), visible);
</ins><span class="cx">     }
</span><del>-    return WKRectMake(geometry.x, geometry.y, geometry.width, geometry.height);
-}
</del><span class="cx"> 
</span><del>-static void setWindowFrame(WKPageRef, WKRect frame, const void* clientInfo)
-{
-    WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(clientInfo));
-    GdkRectangle geometry = { static_cast&lt;int&gt;(frame.origin.x), static_cast&lt;int&gt;(frame.origin.y),
-        static_cast&lt;int&gt;(frame.size.width), static_cast&lt;int&gt;(frame.size.height) };
-    webkitWindowPropertiesSetGeometry(windowProperties, &amp;geometry);
-}
</del><ins>+    virtual bool isResizable(WebPageProxy*) override
+    {
+        return webkit_window_properties_get_resizable(webkit_web_view_get_window_properties(m_webView));
+    }
</ins><span class="cx"> 
</span><del>-static void mouseDidMoveOverElement(WKPageRef, WKHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef /* userData */, const void* clientInfo)
-{
-    webkitWebViewMouseTargetChanged(WEBKIT_WEB_VIEW(clientInfo), toImpl(hitTestResult), wkEventModifiersToGdkModifiers(modifiers));
-}
</del><ins>+    virtual void setIsResizable(WebPageProxy*, bool resizable) override
+    {
+        webkitWindowPropertiesSetResizable(webkit_web_view_get_window_properties(m_webView), resizable);
+    }
</ins><span class="cx"> 
</span><del>-static void printFrame(WKPageRef page, WKFrameRef frame, const void*)
-{
-    webkitWebViewPrintFrame(WEBKIT_WEB_VIEW(toImpl(page)-&gt;viewWidget()), toImpl(frame));
-}
</del><ins>+    virtual void setWindowFrame(WebPageProxy*, const WebCore::FloatRect&amp; frame) override
+    {
+        GdkRectangle geometry = WebCore::IntRect(frame);
+        webkitWindowPropertiesSetGeometry(webkit_web_view_get_window_properties(m_webView), &amp;geometry);
+    }
</ins><span class="cx"> 
</span><del>-static void runOpenPanel(WKPageRef, WKFrameRef, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void *clientInfo)
-{
-    GRefPtr&lt;WebKitFileChooserRequest&gt; request = adoptGRef(webkitFileChooserRequestCreate(toImpl(parameters), toImpl(listener)));
-    webkitWebViewRunFileChooserRequest(WEBKIT_WEB_VIEW(clientInfo), request.get());
-}
</del><ins>+    virtual WebCore::FloatRect windowFrame(WebPageProxy*) override
+    {
+        GdkRectangle geometry = { 0, 0, 0, 0 };
+        GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
+        if (WebCore::widgetIsOnscreenToplevelWindow(window) &amp;&amp; gtk_widget_get_visible(window)) {
+            gtk_window_get_position(GTK_WINDOW(window), &amp;geometry.x, &amp;geometry.y);
+            gtk_window_get_size(GTK_WINDOW(window), &amp;geometry.width, &amp;geometry.height);
+        }
+        return WebCore::FloatRect(geometry);
+    }
</ins><span class="cx"> 
</span><del>-static void decidePolicyForGeolocationPermissionRequest(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKGeolocationPermissionRequestRef request, const void* clientInfo)
-{
-    GRefPtr&lt;WebKitGeolocationPermissionRequest&gt; geolocationPermissionRequest = adoptGRef(webkitGeolocationPermissionRequestCreate(toImpl(request)));
-    webkitWebViewMakePermissionRequest(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_PERMISSION_REQUEST(geolocationPermissionRequest.get()));
-}
</del><ins>+    virtual bool runOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener) override
+    {
+        GRefPtr&lt;WebKitFileChooserRequest&gt; request = adoptGRef(webkitFileChooserRequestCreate(parameters, listener));
+        webkitWebViewRunFileChooserRequest(m_webView, request.get());
+        return true;
+    }
</ins><span class="cx"> 
</span><del>-static void runModal(WKPageRef, const void* clientInfo)
-{
-    webkitWebViewRunAsModal(WEBKIT_WEB_VIEW(clientInfo));
-}
</del><ins>+    virtual bool decidePolicyForGeolocationPermissionRequest(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, GeolocationPermissionRequestProxy* permissionRequest) override
+    {
+        GRefPtr&lt;WebKitGeolocationPermissionRequest&gt; geolocationPermissionRequest = adoptGRef(webkitGeolocationPermissionRequestCreate(permissionRequest));
+        webkitWebViewMakePermissionRequest(m_webView, WEBKIT_PERMISSION_REQUEST(geolocationPermissionRequest.get()));
+        return true;
+    }
</ins><span class="cx"> 
</span><ins>+    virtual void printFrame(WebPageProxy*, WebFrameProxy* frame) override
+    {
+        webkitWebViewPrintFrame(m_webView, frame);
+    }
+
+    virtual bool canRunModal() const override { return true; }
+
+    virtual void runModal(WebPageProxy*) override
+    {
+        webkitWebViewRunAsModal(m_webView);
+    }
+
+    WebKitWebView* m_webView;
+};
+
</ins><span class="cx"> void attachUIClientToView(WebKitWebView* webView)
</span><span class="cx"> {
</span><del>-    WKPageUIClientV2 wkUIClient = {
-        {
-            2, // version
-            webView, // clientInfo
-        },
-        0, // createNewPage_deprecatedForUseWithV0
-        showPage,
-        closePage,
-        0, // takeFocus
-        0, // focus
-        0, // unfocus
-        runJavaScriptAlert,
-        runJavaScriptConfirm,
-        runJavaScriptPrompt,
-        0, // setStatusText
-        0, // mouseDidMoveOverElement_deprecatedForUseWithV0
-        0, // missingPluginButtonClicked
-        0, // didNotHandleKeyEvent
-        0, // didNotHandleWheelEvent
-        toolbarsAreVisible,
-        setToolbarsAreVisible,
-        menuBarIsVisible,
-        setMenuBarIsVisible,
-        statusBarIsVisible,
-        setStatusBarIsVisible,
-        isResizable,
-        setIsResizable,
-        getWindowFrame,
-        setWindowFrame,
-        0, // runBeforeUnloadConfirmPanel
-        0, // didDraw
-        0, // pageDidScroll
-        0, // exceededDatabaseQuota
-        runOpenPanel,
-        decidePolicyForGeolocationPermissionRequest,
-        0, // headerHeight
-        0, // footerHeight
-        0, // drawHeader
-        0, // drawFooter
-        printFrame,
-        runModal,
-        0, // didCompleteRubberBandForMainFrame
-        0, // saveDataToFileInDownloadsFolder
-        0, // shouldInterruptJavaScript
-        createNewPage,
-        mouseDidMoveOverElement,
-        0, // decidePolicyForNotificationPermissionRequest
-        0, // unavailablePluginButtonClicked
-        0, // showColorPicker
-        0, // hideColorPicker
-        0, // pluginLoadPolicy
-    };
-    WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
-    WKPageSetPageUIClient(wkPage, &amp;wkUIClient.base);
</del><ins>+    WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
+    page-&gt;setUIClient(std::make_unique&lt;UIClient&gt;(webView));
</ins><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -217,9 +217,9 @@
</span><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static GtkWidget* webkitWebViewCreate(WebKitWebView*)
</del><ins>+static GtkWidget* webkitWebViewCreate(WebKitWebView*, WebKitNavigationAction*)
</ins><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static GtkWidget* webkitWebViewCreateJavaScriptDialog(WebKitWebView* webView, GtkMessageType type, GtkButtonsType buttons, int defaultResponse, const char* message)
</span><span class="lines">@@ -889,14 +889,18 @@
</span><span class="cx">     /**
</span><span class="cx">      * WebKitWebView::create:
</span><span class="cx">      * @web_view: the #WebKitWebView on which the signal is emitted
</span><ins>+     * @navigation_action: a #WebKitNavigationAction
</ins><span class="cx">      *
</span><span class="cx">      * Emitted when the creation of a new #WebKitWebView is requested.
</span><span class="cx">      * If this signal is handled the signal handler should return the
</span><span class="cx">      * newly created #WebKitWebView.
</span><span class="cx">      *
</span><ins>+     * The #WebKitNavigationAction parameter contains information about the
+     * navigation action that triggered this signal.
+     *
</ins><span class="cx">      * When using %WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES
</span><span class="cx">      * process model, the new #WebKitWebView should be related to
</span><del>-     * @web_view to share the same web process, see webkit_web_view_new_with_related_view
</del><ins>+     * @web_view to share the same web process, see webkit_web_view_new_with_related_view()
</ins><span class="cx">      * for more details.
</span><span class="cx">      *
</span><span class="cx">      * The new #WebKitWebView should not be displayed to the user
</span><span class="lines">@@ -905,14 +909,15 @@
</span><span class="cx">      * Returns: (transfer full): a newly allocated #WebKitWebView widget
</span><span class="cx">      *    or %NULL to propagate the event further.
</span><span class="cx">      */
</span><del>-    signals[CREATE] =
-        g_signal_new(&quot;create&quot;,
-                     G_TYPE_FROM_CLASS(webViewClass),
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET(WebKitWebViewClass, create),
-                     webkitWebViewAccumulatorObjectHandled, 0,
-                     webkit_marshal_OBJECT__VOID,
-                     GTK_TYPE_WIDGET, 0);
</del><ins>+    signals[CREATE] = g_signal_new(
+        &quot;create&quot;,
+        G_TYPE_FROM_CLASS(webViewClass),
+        G_SIGNAL_RUN_LAST,
+        G_STRUCT_OFFSET(WebKitWebViewClass, create),
+        webkitWebViewAccumulatorObjectHandled, 0,
+        g_cclosure_marshal_generic,
+        GTK_TYPE_WIDGET, 1,
+        WEBKIT_TYPE_NAVIGATION_ACTION | G_SIGNAL_TYPE_STATIC_SCOPE);
</ins><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * WebKitWebView::ready-to-show:
</span><span class="lines">@@ -1601,10 +1606,10 @@
</span><span class="cx">     g_object_notify(G_OBJECT(webView), &quot;uri&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView* webView, ImmutableDictionary* windowFeatures)
</del><ins>+WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView* webView, const WindowFeatures&amp; windowFeatures, WebKitNavigationAction* navigationAction)
</ins><span class="cx"> {
</span><span class="cx">     WebKitWebView* newWebView;
</span><del>-    g_signal_emit(webView, signals[CREATE], 0, &amp;newWebView);
</del><ins>+    g_signal_emit(webView, signals[CREATE], 0, navigationAction, &amp;newWebView);
</ins><span class="cx">     if (!newWebView)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="lines">@@ -1674,9 +1679,9 @@
</span><span class="cx">     g_signal_emit(webView, signals[PERMISSION_REQUEST], 0, request, &amp;returnValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void webkitWebViewMouseTargetChanged(WebKitWebView* webView, WebHitTestResult* hitTestResult, unsigned modifiers)
</del><ins>+void webkitWebViewMouseTargetChanged(WebKitWebView* webView, const WebHitTestResult::Data&amp; hitTestResult, unsigned modifiers)
</ins><span class="cx"> {
</span><del>-    webkitWebViewBaseSetTooltipArea(WEBKIT_WEB_VIEW_BASE(webView), hitTestResult-&gt;elementBoundingBox());
</del><ins>+    webkitWebViewBaseSetTooltipArea(WEBKIT_WEB_VIEW_BASE(webView), hitTestResult.elementBoundingBox);
</ins><span class="cx"> 
</span><span class="cx">     WebKitWebViewPrivate* priv = webView-&gt;priv;
</span><span class="cx">     if (priv-&gt;mouseTargetHitTestResult
</span><span class="lines">@@ -1828,7 +1833,19 @@
</span><span class="cx">     if (webHitTestResult-&gt;isContentEditable())
</span><span class="cx">         webkitWebViewCreateAndAppendInputMethodsMenuItem(webView, contextMenu.get());
</span><span class="cx"> 
</span><del>-    GRefPtr&lt;WebKitHitTestResult&gt; hitTestResult = adoptGRef(webkitHitTestResultCreate(webHitTestResult));
</del><ins>+    // FIXME: we should use a custom ContextMenuClient at some point, that will receive a
+    // const WebHitTestResult::Data&amp; that we can use directly here.
+    WebHitTestResult::Data data;
+    data.absoluteImageURL = webHitTestResult-&gt;absoluteImageURL();
+    data.absoluteLinkURL = webHitTestResult-&gt;absoluteLinkURL();
+    data.absoluteMediaURL = webHitTestResult-&gt;absoluteMediaURL();
+    data.linkLabel = webHitTestResult-&gt;linkLabel();
+    data.linkTitle = webHitTestResult-&gt;linkTitle();
+    data.isContentEditable = webHitTestResult-&gt;isContentEditable();
+    data.elementBoundingBox = webHitTestResult-&gt;elementBoundingBox();
+    data.isScrollbar = webHitTestResult-&gt;isScrollbar();
+
+    GRefPtr&lt;WebKitHitTestResult&gt; hitTestResult = adoptGRef(webkitHitTestResultCreate(data));
</ins><span class="cx">     GUniquePtr&lt;GdkEvent&gt; contextMenuEvent(webkitWebViewBaseTakeContextMenuEvent(webViewBase));
</span><span class="cx"> 
</span><span class="cx">     gboolean returnValue;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &lt;webkit2/WebKitForwardDeclarations.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitHitTestResult.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitJavascriptResult.h&gt;
</span><ins>+#include &lt;webkit2/WebKitNavigationAction.h&gt;
</ins><span class="cx"> #include &lt;webkit2/WebKitPermissionRequest.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitPolicyDecision.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitScriptDialog.h&gt;
</span><span class="lines">@@ -194,7 +195,8 @@
</span><span class="cx">                                                 const gchar                 *failing_uri,
</span><span class="cx">                                                 GError                      *error);
</span><span class="cx"> 
</span><del>-    GtkWidget *(* create)                      (WebKitWebView               *web_view);
</del><ins>+    GtkWidget *(* create)                      (WebKitWebView               *web_view,
+                                                WebKitNavigationAction      *navigation_action);
</ins><span class="cx">     void       (* ready_to_show)               (WebKitWebView               *web_view);
</span><span class="cx">     void       (* run_as_modal)                (WebKitWebView               *web_view);
</span><span class="cx">     void       (* close)                       (WebKitWebView               *web_view);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #ifndef WebKitWebViewPrivate_h
</span><span class="cx"> #define WebKitWebViewPrivate_h
</span><span class="cx"> 
</span><ins>+#include &quot;WebHitTestResult.h&quot;
</ins><span class="cx"> #include &quot;WebImage.h&quot;
</span><span class="cx"> #include &quot;WebKitWebView.h&quot;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="lines">@@ -37,7 +38,7 @@
</span><span class="cx"> void webkitWebViewSetEstimatedLoadProgress(WebKitWebView*, double estimatedLoadProgress);
</span><span class="cx"> void webkitWebViewSetTitle(WebKitWebView*, const CString&amp;);
</span><span class="cx"> void webkitWebViewUpdateURI(WebKitWebView*);
</span><del>-WebKit::WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView*, WebKit::ImmutableDictionary* windowFeatures);
</del><ins>+WebKit::WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView*, const WebCore::WindowFeatures&amp;, WebKitNavigationAction*);
</ins><span class="cx"> void webkitWebViewReadyToShowPage(WebKitWebView*);
</span><span class="cx"> void webkitWebViewRunAsModal(WebKitWebView*);
</span><span class="cx"> void webkitWebViewClosePage(WebKitWebView*);
</span><span class="lines">@@ -46,7 +47,7 @@
</span><span class="cx"> CString webkitWebViewRunJavaScriptPrompt(WebKitWebView*, const CString&amp; message, const CString&amp; defaultText);
</span><span class="cx"> void webkitWebViewMakePermissionRequest(WebKitWebView*, WebKitPermissionRequest*);
</span><span class="cx"> void webkitWebViewMakePolicyDecision(WebKitWebView*, WebKitPolicyDecisionType, WebKitPolicyDecision*);
</span><del>-void webkitWebViewMouseTargetChanged(WebKitWebView*, WebKit::WebHitTestResult*, unsigned modifiers);
</del><ins>+void webkitWebViewMouseTargetChanged(WebKitWebView*, const WebKit::WebHitTestResult::Data&amp;, unsigned modifiers);
</ins><span class="cx"> void webkitWebViewPrintFrame(WebKitWebView*, WebKit::WebFrameProxy*);
</span><span class="cx"> void webkitWebViewResourceLoadStarted(WebKitWebView*, WebKit::WebFrameProxy*, uint64_t resourceIdentifier, WebKitURIRequest*);
</span><span class="cx"> void webkitWebViewRunFileChooserRequest(WebKitWebView*, WebKitFileChooserRequest*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWindowPropertiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;WebKitPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitWindowPropertiesPrivate.h&quot;
</span><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><ins>+#include &lt;WebCore/WindowFeatures.h&gt;
</ins><span class="cx"> #include &lt;glib/gi18n-lib.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="lines">@@ -374,54 +375,26 @@
</span><span class="cx">     g_object_notify(G_OBJECT(windowProperties), &quot;fullscreen&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties* windowProperties, ImmutableDictionary* features)
</del><ins>+void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties* windowProperties, const WindowFeatures&amp; windowFeatures)
</ins><span class="cx"> {
</span><span class="cx">     GdkRectangle geometry = windowProperties-&gt;priv-&gt;geometry;
</span><del>-
-    API::Double* doubleValue = static_cast&lt;API::Double*&gt;(features-&gt;get(&quot;x&quot;));
-    if (doubleValue)
-        geometry.x = doubleValue-&gt;value();
-
-    doubleValue = static_cast&lt;API::Double*&gt;(features-&gt;get(&quot;y&quot;));
-    if (doubleValue)
-        geometry.y = doubleValue-&gt;value();
-
-    doubleValue = static_cast&lt;API::Double*&gt;(features-&gt;get(&quot;width&quot;));
-    if (doubleValue)
-        geometry.width = doubleValue-&gt;value();
-
-    doubleValue = static_cast&lt;API::Double*&gt;(features-&gt;get(&quot;height&quot;));
-    if (doubleValue)
-        geometry.height = doubleValue-&gt;value();
</del><ins>+    if (windowFeatures.xSet)
+        geometry.x = windowFeatures.x;
+    if (windowFeatures.ySet)
+        geometry.y = windowFeatures.y;
+    if (windowFeatures.widthSet)
+        geometry.width = windowFeatures.width;
+    if (windowFeatures.heightSet)
+        geometry.height = windowFeatures.height;
</ins><span class="cx">     webkitWindowPropertiesSetGeometry(windowProperties, &amp;geometry);
</span><span class="cx"> 
</span><del>-    API::Boolean* booleanValue = static_cast&lt;API::Boolean*&gt;(features-&gt;get(&quot;menuBarVisible&quot;));
-    if (booleanValue)
-        webkitWindowPropertiesSetMenubarVisible(windowProperties, booleanValue-&gt;value());
-
-    booleanValue = static_cast&lt;API::Boolean*&gt;(features-&gt;get(&quot;statusBarVisible&quot;));
-    if (booleanValue)
-        webkitWindowPropertiesSetStatusbarVisible(windowProperties, booleanValue-&gt;value());
-
-    booleanValue = static_cast&lt;API::Boolean*&gt;(features-&gt;get(&quot;toolBarVisible&quot;));
-    if (booleanValue)
-        webkitWindowPropertiesSetToolbarVisible(windowProperties, booleanValue-&gt;value());
-
-    booleanValue = static_cast&lt;API::Boolean*&gt;(features-&gt;get(&quot;locationBarVisible&quot;));
-    if (booleanValue)
-        webkitWindowPropertiesSetLocationbarVisible(windowProperties, booleanValue-&gt;value());
-
-    booleanValue = static_cast&lt;API::Boolean*&gt;(features-&gt;get(&quot;scrollbarsVisible&quot;));
-    if (booleanValue)
-        webkitWindowPropertiesSetScrollbarsVisible(windowProperties, booleanValue-&gt;value());
-
-    booleanValue = static_cast&lt;API::Boolean*&gt;(features-&gt;get(&quot;resizable&quot;));
-    if (booleanValue)
-        webkitWindowPropertiesSetResizable(windowProperties, booleanValue-&gt;value());
-
-    booleanValue = static_cast&lt;API::Boolean*&gt;(features-&gt;get(&quot;fullscreen&quot;));
-    if (booleanValue)
-        webkitWindowPropertiesSetFullscreen(windowProperties, booleanValue-&gt;value());
</del><ins>+    webkitWindowPropertiesSetMenubarVisible(windowProperties, windowFeatures.menuBarVisible);
+    webkitWindowPropertiesSetStatusbarVisible(windowProperties, windowFeatures.statusBarVisible);
+    webkitWindowPropertiesSetToolbarVisible(windowProperties, windowFeatures.toolBarVisible);
+    webkitWindowPropertiesSetLocationbarVisible(windowProperties, windowFeatures.locationBarVisible);
+    webkitWindowPropertiesSetScrollbarsVisible(windowProperties, windowFeatures.scrollbarsVisible);
+    webkitWindowPropertiesSetResizable(windowProperties, windowFeatures.resizable);
+    webkitWindowPropertiesSetFullscreen(windowProperties, windowFeatures.fullscreen);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWindowPropertiesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include &quot;WebKitWindowProperties.h&quot;
</span><span class="cx"> 
</span><span class="cx"> WebKitWindowProperties* webkitWindowPropertiesCreate();
</span><del>-void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties*, WebKit::ImmutableDictionary* features);
</del><ins>+void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties*, const WebCore::WindowFeatures&amp;);
</ins><span class="cx"> void webkitWindowPropertiesSetGeometry(WebKitWindowProperties*, GdkRectangle*);
</span><span class="cx"> void webkitWindowPropertiesSetToolbarVisible(WebKitWindowProperties*, bool toolbarsVisible);
</span><span class="cx"> void webkitWindowPropertiesSetMenubarVisible(WebKitWindowProperties*, bool menuBarVisible);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitDownload.xml&quot;/&gt;
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitPermissionRequest.xml&quot;/&gt;
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitGeolocationPermissionRequest.xml&quot;/&gt;
</span><ins>+    &lt;xi:include href=&quot;xml/WebKitNavigationAction.xml&quot;/&gt;
</ins><span class="cx">     &lt;xi:include href=&quot;xml/WebKitPolicyDecision.xml&quot;/&gt;
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitNavigationPolicyDecision.xml&quot;/&gt;
</span><span class="cx">     &lt;xi:include href=&quot;xml/WebKitResponsePolicyDecision.xml&quot;/&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -521,6 +521,24 @@
</span><span class="cx"> &lt;/SECTION&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;SECTION&gt;
</span><ins>+&lt;FILE&gt;WebKitNavigationAction&lt;/FILE&gt;
+WebKitNavigationAction
+webkit_navigation_action_copy
+webkit_navigation_action_free
+webkit_navigation_action_get_navigation_type
+webkit_navigation_action_get_mouse_button
+webkit_navigation_action_get_modifiers
+webkit_navigation_action_get_request
+webkit_navigation_action_is_user_gesture
+
+&lt;SUBSECTION Standard&gt;
+WEBKIT_TYPE_NAVIGATION_ACTION
+
+&lt;SUBSECTION Private&gt;
+webkit_navigation_action_get_type
+&lt;/SECTION&gt;
+
+&lt;SECTION&gt;
</ins><span class="cx"> &lt;FILE&gt;WebKitPolicyDecision&lt;/FILE&gt;
</span><span class="cx"> WebKitPolicyDecision
</span><span class="cx"> webkit_policy_decision_download
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkwebkit2h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include &lt;webkit2/WebKitHitTestResult.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitJavascriptResult.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitMimeInfo.h&gt;
</span><ins>+#include &lt;webkit2/WebKitNavigationAction.h&gt;
</ins><span class="cx"> #include &lt;webkit2/WebKitNavigationPolicyDecision.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitPermissionRequest.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitPlugin.h&gt;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Tools/ChangeLog        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2014-07-02  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [GTK] WebKitWebView::create should receive information about the navigation action
+        https://bugs.webkit.org/show_bug.cgi?id=133680
+
+        Reviewed by Martin Robinson.
+
+        Add unit test to check the WebKitNavigationAction passed to
+        WebKitWebView::create callback.
+
+        * MiniBrowser/gtk/BrowserWindow.c:
+        (webViewCreate): Add WebKitNavigationAction parameter.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
+        (testWebViewCreateNavigationData):
+        (beforeAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitPolicyClient.cpp:
+        (createCallback):
+
+2014-07-02  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
</ins><span class="cx">         [GTK] Do not add forward declaration of class struct for interfaces
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=134297
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsMiniBrowsergtkBrowserWindowc"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/gtk/BrowserWindow.c (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/gtk/BrowserWindow.c        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Tools/MiniBrowser/gtk/BrowserWindow.c        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -348,7 +348,7 @@
</span><span class="cx">     return FALSE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static GtkWidget *webViewCreate(WebKitWebView *webView, BrowserWindow *window)
</del><ins>+static GtkWidget *webViewCreate(WebKitWebView *webView, WebKitNavigationAction *navigation, BrowserWindow *window)
</ins><span class="cx"> {
</span><span class="cx">     WebKitWebView *newWebView = WEBKIT_WEB_VIEW(webkit_web_view_new_with_related_view(webView));
</span><span class="cx">     webkit_web_view_set_settings(newWebView, webkit_web_view_get_settings(webView));
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestMultiprocesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">         Close
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static GtkWidget* viewCreateCallback(WebKitWebView* webView, UIClientMultiprocessTest* test)
</del><ins>+    static GtkWidget* viewCreateCallback(WebKitWebView* webView, WebKitNavigationAction*, UIClientMultiprocessTest* test)
</ins><span class="cx">     {
</span><span class="cx">         return test-&gt;viewCreate(webView);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestPrintingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(CloseAfterPrintTest);
</span><span class="cx"> 
</span><del>-    static GtkWidget* webViewCreate(WebKitWebView* webView, CloseAfterPrintTest* test)
</del><ins>+    static GtkWidget* webViewCreate(WebKitWebView* webView, WebKitNavigationAction*, CloseAfterPrintTest* test)
</ins><span class="cx">     {
</span><span class="cx">         return test-&gt;createWebView();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestUIClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -117,9 +117,9 @@
</span><span class="cx">         test-&gt;m_windowPropertiesChanged.add(g_param_spec_get_name(paramSpec));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static GtkWidget* viewCreateCallback(WebKitWebView* webView, UIClientTest* test)
</del><ins>+    static GtkWidget* viewCreateCallback(WebKitWebView* webView, WebKitNavigationAction* navigation, UIClientTest* test)
</ins><span class="cx">     {
</span><del>-        return test-&gt;viewCreate(webView);
</del><ins>+        return test-&gt;viewCreate(webView, navigation);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static void viewReadyToShowCallback(WebKitWebView* webView, UIClientTest* test)
</span><span class="lines">@@ -240,9 +240,10 @@
</span><span class="cx">         return m_mouseTargetHitTestResult.get();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual GtkWidget* viewCreate(WebKitWebView* webView)
</del><ins>+    virtual GtkWidget* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation)
</ins><span class="cx">     {
</span><span class="cx">         g_assert(webView == m_webView);
</span><ins>+        g_assert(navigation);
</ins><span class="cx"> 
</span><span class="cx">         GtkWidget* newWebView = webkit_web_view_new_with_context(webkit_web_view_get_context(webView));
</span><span class="cx">         g_object_ref_sink(newWebView);
</span><span class="lines">@@ -305,6 +306,91 @@
</span><span class="cx">     g_assert_cmpint(events[2], ==, UIClientTest::Close);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class CreateNavigationDataTest: public UIClientTest {
+public:
+    MAKE_GLIB_TEST_FIXTURE(CreateNavigationDataTest);
+
+    CreateNavigationDataTest()
+        : m_navigation(nullptr)
+    {
+    }
+
+    ~CreateNavigationDataTest()
+    {
+        clearNavigation();
+    }
+
+    void clearNavigation()
+    {
+        if (m_navigation)
+            webkit_navigation_action_free(m_navigation);
+        m_navigation = nullptr;
+    }
+
+    GtkWidget* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation)
+    {
+        g_assert(navigation);
+        g_assert(!m_navigation);
+        m_navigation = webkit_navigation_action_copy(navigation);
+        g_main_loop_quit(m_mainLoop);
+        return nullptr;
+    }
+
+    void loadHTML(const char* html)
+    {
+        clearNavigation();
+        WebViewTest::loadHtml(html, nullptr);
+    }
+
+    void clickAndWaitUntilMainLoopFinishes(int x, int y)
+    {
+        clearNavigation();
+        clickMouseButton(x, y, 1);
+        g_main_loop_run(m_mainLoop);
+    }
+
+    WebKitNavigationAction* m_navigation;
+};
+
+static void testWebViewCreateNavigationData(CreateNavigationDataTest* test, gconstpointer)
+{
+    test-&gt;showInWindowAndWaitUntilMapped();
+
+    test-&gt;loadHTML(
+        &quot;&lt;html&gt;&lt;body&gt;&quot;
+        &quot;&lt;input style=\&quot;position:absolute; left:0; top:0; margin:0; padding:0\&quot; type=\&quot;button\&quot; value=\&quot;click to show a popup\&quot; onclick=\&quot;window.open('data:foo');\&quot;/&gt;&quot;
+        &quot;&lt;a style=\&quot;position:absolute; left:20; top:20;\&quot; href=\&quot;data:bar\&quot; target=\&quot;_blank\&quot;&gt;popup link&lt;/a&gt;&quot;
+        &quot;&lt;/body&gt;&lt;/html&gt;&quot;);
+    test-&gt;waitUntilLoadFinished();
+
+    // Click on a button.
+    test-&gt;clickAndWaitUntilMainLoopFinishes(5, 5);
+    g_assert_cmpstr(webkit_uri_request_get_uri(webkit_navigation_action_get_request(test-&gt;m_navigation)), ==, &quot;data:foo&quot;);
+    g_assert_cmpuint(webkit_navigation_action_get_navigation_type(test-&gt;m_navigation), ==, WEBKIT_NAVIGATION_TYPE_OTHER);
+    // FIXME: This should be button 1.
+    g_assert_cmpuint(webkit_navigation_action_get_mouse_button(test-&gt;m_navigation), ==, 0);
+    g_assert_cmpuint(webkit_navigation_action_get_modifiers(test-&gt;m_navigation), ==, 0);
+    g_assert(webkit_navigation_action_is_user_gesture(test-&gt;m_navigation));
+
+    // Click on a link.
+    test-&gt;clickAndWaitUntilMainLoopFinishes(21, 21);
+    g_assert_cmpstr(webkit_uri_request_get_uri(webkit_navigation_action_get_request(test-&gt;m_navigation)), ==, &quot;data:bar&quot;);
+    g_assert_cmpuint(webkit_navigation_action_get_navigation_type(test-&gt;m_navigation), ==, WEBKIT_NAVIGATION_TYPE_LINK_CLICKED);
+    g_assert_cmpuint(webkit_navigation_action_get_mouse_button(test-&gt;m_navigation), ==, 1);
+    g_assert_cmpuint(webkit_navigation_action_get_modifiers(test-&gt;m_navigation), ==, 0);
+    g_assert(webkit_navigation_action_is_user_gesture(test-&gt;m_navigation));
+
+    // No user interaction.
+    test-&gt;loadHTML(&quot;&lt;html&gt;&lt;body onLoad=\&quot;window.open();\&quot;&gt;&lt;/html&gt;&quot;);
+    test-&gt;waitUntilMainLoopFinishes();
+
+    g_assert_cmpstr(webkit_uri_request_get_uri(webkit_navigation_action_get_request(test-&gt;m_navigation)), ==, &quot;&quot;);
+    g_assert_cmpuint(webkit_navigation_action_get_navigation_type(test-&gt;m_navigation), ==, WEBKIT_NAVIGATION_TYPE_OTHER);
+    g_assert_cmpuint(webkit_navigation_action_get_mouse_button(test-&gt;m_navigation), ==, 0);
+    g_assert_cmpuint(webkit_navigation_action_get_modifiers(test-&gt;m_navigation), ==, 0);
+    g_assert(!webkit_navigation_action_is_user_gesture(test-&gt;m_navigation));
+}
+
</ins><span class="cx"> static gboolean checkMimeTypeForFilter(GtkFileFilter* filter, const gchar* mimeType)
</span><span class="cx"> {
</span><span class="cx">     GtkFileFilterInfo filterInfo;
</span><span class="lines">@@ -323,11 +409,11 @@
</span><span class="cx">         test-&gt;m_webViewEvents.append(RunAsModal);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GtkWidget* viewCreate(WebKitWebView* webView)
</del><ins>+    GtkWidget* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation)
</ins><span class="cx">     {
</span><span class="cx">         g_assert(webView == m_webView);
</span><span class="cx"> 
</span><del>-        GtkWidget* newWebView = UIClientTest::viewCreate(webView);
</del><ins>+        GtkWidget* newWebView = UIClientTest::viewCreate(webView, navigation);
</ins><span class="cx">         g_signal_connect(newWebView, &quot;run-as-modal&quot;, G_CALLBACK(dialogRunAsModalCallback), this);
</span><span class="cx">         return newWebView;
</span><span class="cx">     }
</span><span class="lines">@@ -665,6 +751,7 @@
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><span class="cx">     UIClientTest::add(&quot;WebKitWebView&quot;, &quot;create-ready-close&quot;, testWebViewCreateReadyClose);
</span><ins>+    CreateNavigationDataTest::add(&quot;WebKitWebView&quot;, &quot;create-navigation-data&quot;, testWebViewCreateNavigationData);
</ins><span class="cx">     ModalDialogsTest::add(&quot;WebKitWebView&quot;, &quot;allow-modal-dialogs&quot;, testWebViewAllowModalDialogs);
</span><span class="cx">     ModalDialogsTest::add(&quot;WebKitWebView&quot;, &quot;disallow-modal-dialogs&quot;, testWebViewDisallowModalDialogs);
</span><span class="cx">     UIClientTest::add(&quot;WebKitWebView&quot;, &quot;javascript-dialogs&quot;, testWebViewJavaScriptDialogs);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitPolicyClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitPolicyClient.cpp (170701 => 170702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitPolicyClient.cpp        2014-07-02 07:09:26 UTC (rev 170701)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitPolicyClient.cpp        2014-07-02 07:19:46 UTC (rev 170702)
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx">     GMainLoop* mainLoop;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static WebKitWebView* createCallback(WebKitWebView* webView, CreateCallbackData* data)
</del><ins>+static WebKitWebView* createCallback(WebKitWebView* webView, WebKitNavigationAction*, CreateCallbackData* data)
</ins><span class="cx"> {
</span><span class="cx">     data-&gt;triedToOpenWindow = true;
</span><span class="cx">     g_main_loop_quit(data-&gt;mainLoop);
</span></span></pre>
</div>
</div>

</body>
</html>