<!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>[166733] trunk/Source/WebKit2</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>WKWebView should always have a UIDelegate, even when closed
https://bugs.webkit.org/show_bug.cgi?id=131174
&lt;rdar://problem/16389248&gt;

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView UIDelegate]):
(-[WKWebView setUIDelegate:]):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIDelegate):
(WebKit::UIDelegate::~UIDelegate):
(WebKit::UIDelegate::createUIClient):
(WebKit::UIDelegate::delegate):
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::UIClient):
(WebKit::UIDelegate::UIClient::~UIClient):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::runJavaScriptAlert):
(WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
(WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
(WebKit::UIDelegate::UIClient::actionsForElement):
(WebKit::UIClient::UIClient): Deleted.
(WebKit::UIClient::~UIClient): Deleted.
(WebKit::UIClient::delegate): Deleted.
(WebKit::UIClient::setDelegate): Deleted.
(WebKit::UIClient::createNewPage): Deleted.
(WebKit::UIClient::runJavaScriptAlert): Deleted.
(WebKit::UIClient::runJavaScriptConfirm): Deleted.
(WebKit::UIClient::runJavaScriptPrompt): Deleted.
(WebKit::UIClient::actionsForElement): Deleted.
* UIProcess/ios/WKActionSheetAssistant.mm:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaUIDelegateh">trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaUIDelegatemm">trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKActionSheetAssistantmm">trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (166732 => 166733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-03 18:25:26 UTC (rev 166732)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-03 18:34:18 UTC (rev 166733)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2014-04-03  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        WKWebView should always have a UIDelegate, even when closed
+        https://bugs.webkit.org/show_bug.cgi?id=131174
+        &lt;rdar://problem/16389248&gt;
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView initWithFrame:configuration:]):
+        (-[WKWebView UIDelegate]):
+        (-[WKWebView setUIDelegate:]):
+        * UIProcess/Cocoa/UIDelegate.h:
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::UIDelegate::UIDelegate):
+        (WebKit::UIDelegate::~UIDelegate):
+        (WebKit::UIDelegate::createUIClient):
+        (WebKit::UIDelegate::delegate):
+        (WebKit::UIDelegate::setDelegate):
+        (WebKit::UIDelegate::UIClient::UIClient):
+        (WebKit::UIDelegate::UIClient::~UIClient):
+        (WebKit::UIDelegate::UIClient::createNewPage):
+        (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
+        (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
+        (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
+        (WebKit::UIDelegate::UIClient::actionsForElement):
+        (WebKit::UIClient::UIClient): Deleted.
+        (WebKit::UIClient::~UIClient): Deleted.
+        (WebKit::UIClient::delegate): Deleted.
+        (WebKit::UIClient::setDelegate): Deleted.
+        (WebKit::UIClient::createNewPage): Deleted.
+        (WebKit::UIClient::runJavaScriptAlert): Deleted.
+        (WebKit::UIClient::runJavaScriptConfirm): Deleted.
+        (WebKit::UIClient::runJavaScriptPrompt): Deleted.
+        (WebKit::UIClient::actionsForElement): Deleted.
+        * UIProcess/ios/WKActionSheetAssistant.mm:
+
</ins><span class="cx"> 2014-04-02  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Document WKNavigationAction and WKNavigationResponse
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (166732 => 166733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-04-03 18:25:26 UTC (rev 166732)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-04-03 18:34:18 UTC (rev 166733)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKWebView {
</span><span class="cx">     std::unique_ptr&lt;WebKit::NavigationState&gt; _navigationState;
</span><ins>+    std::unique_ptr&lt;WebKit::UIDelegate&gt; _uiDelegate;
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;_WKRemoteObjectRegistry&gt; _remoteObjectRegistry;
</span><span class="cx">     _WKRenderingProgressEvents _observedRenderingProgressEvents;
</span><span class="lines">@@ -199,8 +200,12 @@
</span><span class="cx">     _navigationState = std::make_unique&lt;WebKit::NavigationState&gt;(self);
</span><span class="cx">     _page-&gt;setPolicyClient(_navigationState-&gt;createPolicyClient());
</span><span class="cx">     _page-&gt;setLoaderClient(_navigationState-&gt;createLoaderClient());
</span><del>-    _page-&gt;setUIClient(std::make_unique&lt;WebKit::UIClient&gt;(self));
</del><ins>+
+    _uiDelegate = std::make_unique&lt;WebKit::UIDelegate&gt;(self);
+    _page-&gt;setUIClient(_uiDelegate-&gt;createUIClient());
+
</ins><span class="cx">     _page-&gt;setFindClient(std::make_unique&lt;WebKit::FindClient&gt;(self));
</span><ins>+
</ins><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -237,20 +242,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (id &lt;WKUIDelegate&gt;)UIDelegate
</span><span class="cx"> {
</span><del>-    // FIXME: A closed page should still have a UI delegate - it should just never be called.
-    if (_page-&gt;isClosed())
-        return nil;
-
-    return [static_cast&lt;WebKit::UIClient&amp;&gt;(_page-&gt;uiClient()).delegate().leakRef() autorelease];
</del><ins>+    return [_uiDelegate-&gt;delegate().leakRef() autorelease];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setUIDelegate:(id&lt;WKUIDelegate&gt;)UIDelegate
</span><span class="cx"> {
</span><del>-    // FIXME: A closed page should still have a UI delegate - it should just never be called.
-    if (_page-&gt;isClosed())
-        return;
-
-    static_cast&lt;WebKit::UIClient&amp;&gt;(_page-&gt;uiClient()).setDelegate(UIDelegate);
</del><ins>+    _uiDelegate-&gt;setDelegate(UIDelegate);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WKNavigation *)loadRequest:(NSURLRequest *)request
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaUIDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h (166732 => 166733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h        2014-04-03 18:25:26 UTC (rev 166732)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h        2014-04-03 18:34:18 UTC (rev 166733)
</span><span class="lines">@@ -40,24 +40,35 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class UIClient : public API::UIClient {
</del><ins>+class UIDelegate {
</ins><span class="cx"> public:
</span><del>-    explicit UIClient(WKWebView *);
-    ~UIClient();
</del><ins>+    explicit UIDelegate(WKWebView *);
+    ~UIDelegate();
</ins><span class="cx"> 
</span><ins>+    std::unique_ptr&lt;API::UIClient&gt; createUIClient();
+
</ins><span class="cx">     RetainPtr&lt;id &lt;WKUIDelegate&gt; &gt; delegate();
</span><span class="cx">     void setDelegate(id &lt;WKUIDelegate&gt;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    // API::UIClient
-    virtual PassRefPtr&lt;WebKit::WebPageProxy&gt; createNewPage(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::ResourceRequest&amp;, const WebCore::WindowFeatures&amp;, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button) override;
-    virtual void runJavaScriptAlert(WebKit::WebPageProxy*, const WTF::String&amp;, WebKit::WebFrameProxy*, std::function&lt;void ()&gt; completionHandler) override;
-    virtual void runJavaScriptConfirm(WebKit::WebPageProxy*, const WTF::String&amp;, WebKit::WebFrameProxy*, std::function&lt;void (bool)&gt; completionHandler) override;
-    virtual void runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&amp;, const WTF::String&amp;, WebKit::WebFrameProxy*, std::function&lt;void (const WTF::String&amp;)&gt; completionHandler) override;
-#if PLATFORM(IOS)
-    virtual RetainPtr&lt;NSArray&gt; actionsForElement(_WKActivatedElementInfo *, RetainPtr&lt;NSArray&gt; defaultActions) override;
-#endif
</del><ins>+    class UIClient : public API::UIClient {
+    public:
+        explicit UIClient(UIDelegate&amp;);
+        ~UIClient();
</ins><span class="cx"> 
</span><ins>+    private:
+        // API::UIClient
+        virtual PassRefPtr&lt;WebKit::WebPageProxy&gt; createNewPage(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::ResourceRequest&amp;, const WebCore::WindowFeatures&amp;, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button) override;
+        virtual void runJavaScriptAlert(WebKit::WebPageProxy*, const WTF::String&amp;, WebKit::WebFrameProxy*, std::function&lt;void ()&gt; completionHandler) override;
+        virtual void runJavaScriptConfirm(WebKit::WebPageProxy*, const WTF::String&amp;, WebKit::WebFrameProxy*, std::function&lt;void (bool)&gt; completionHandler) override;
+        virtual void runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&amp;, const WTF::String&amp;, WebKit::WebFrameProxy*, std::function&lt;void (const WTF::String&amp;)&gt; completionHandler) override;
+    #if PLATFORM(IOS)
+        virtual RetainPtr&lt;NSArray&gt; actionsForElement(_WKActivatedElementInfo *, RetainPtr&lt;NSArray&gt; defaultActions) override;
+    #endif
+
+        UIDelegate&amp; m_uiDelegate;
+    };
+
</ins><span class="cx">     WKWebView *m_webView;
</span><span class="cx">     WeakObjCPtr&lt;id &lt;WKUIDelegate&gt; &gt; m_delegate;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaUIDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm (166732 => 166733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm        2014-04-03 18:25:26 UTC (rev 166732)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm        2014-04-03 18:34:18 UTC (rev 166733)
</span><span class="lines">@@ -37,21 +37,26 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-UIClient::UIClient(WKWebView *webView)
</del><ins>+UIDelegate::UIDelegate(WKWebView *webView)
</ins><span class="cx">     : m_webView(webView)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-UIClient::~UIClient()
</del><ins>+UIDelegate::~UIDelegate()
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RetainPtr&lt;id &lt;WKUIDelegate&gt; &gt; UIClient::delegate()
</del><ins>+std::unique_ptr&lt;API::UIClient&gt; UIDelegate::createUIClient()
</ins><span class="cx"> {
</span><ins>+    return std::make_unique&lt;UIClient&gt;(*this);
+}
+
+RetainPtr&lt;id &lt;WKUIDelegate&gt; &gt; UIDelegate::delegate()
+{
</ins><span class="cx">     return m_delegate.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UIClient::setDelegate(id &lt;WKUIDelegate&gt; delegate)
</del><ins>+void UIDelegate::setDelegate(id &lt;WKUIDelegate&gt; delegate)
</ins><span class="cx"> {
</span><span class="cx">     m_delegate = delegate;
</span><span class="cx"> 
</span><span class="lines">@@ -64,17 +69,26 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;WebKit::WebPageProxy&gt; UIClient::createNewPage(WebKit::WebPageProxy*, WebKit::WebFrameProxy* initiatingFrame, const WebCore::ResourceRequest&amp; request, const WebCore::WindowFeatures&amp; windowFeatures, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button)
</del><ins>+UIDelegate::UIClient::UIClient(UIDelegate&amp; uiDelegate)
+    : m_uiDelegate(uiDelegate)
</ins><span class="cx"> {
</span><del>-    if (!m_delegateMethods.webViewCreateWebViewWithConfigurationForNavigationActionWindowFeatures)
</del><ins>+}
+
+UIDelegate::UIClient::~UIClient()
+{
+}
+
+PassRefPtr&lt;WebKit::WebPageProxy&gt; UIDelegate::UIClient::createNewPage(WebKit::WebPageProxy*, WebKit::WebFrameProxy* initiatingFrame, const WebCore::ResourceRequest&amp; request, const WebCore::WindowFeatures&amp; windowFeatures, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button)
+{
+    if (!m_uiDelegate.m_delegateMethods.webViewCreateWebViewWithConfigurationForNavigationActionWindowFeatures)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto delegate = m_delegate.get();
</del><ins>+    auto delegate = m_uiDelegate.m_delegate.get();
</ins><span class="cx">     if (!delegate)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto configuration = adoptNS([m_webView-&gt;_configuration copy]);
-    [configuration _setRelatedWebView:m_webView];
</del><ins>+    auto configuration = adoptNS([m_uiDelegate.m_webView-&gt;_configuration copy]);
+    [configuration _setRelatedWebView:m_uiDelegate.m_webView];
</ins><span class="cx"> 
</span><span class="cx">     auto navigationAction = adoptNS([[WKNavigationAction alloc] init]);
</span><span class="cx"> 
</span><span class="lines">@@ -83,82 +97,82 @@
</span><span class="cx">     [navigationAction setNavigationType:WKNavigationTypeOther];
</span><span class="cx">     [navigationAction setRequest:request.nsURLRequest(WebCore::DoNotUpdateHTTPBody)];
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;WKWebView&gt; webView = [delegate.get() webView:m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:navigationAction.get() windowFeatures:adoptNS([[WKWindowFeatures alloc] _initWithWindowFeatures:windowFeatures]).get()];
</del><ins>+    RetainPtr&lt;WKWebView&gt; webView = [delegate.get() webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:navigationAction.get() windowFeatures:adoptNS([[WKWindowFeatures alloc] _initWithWindowFeatures:windowFeatures]).get()];
</ins><span class="cx"> 
</span><span class="cx">     if (!webView)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if ([webView-&gt;_configuration _relatedWebView] != m_webView)
</del><ins>+    if ([webView-&gt;_configuration _relatedWebView] != m_uiDelegate.m_webView)
</ins><span class="cx">         [NSException raise:NSInternalInconsistencyException format:@&quot;Returned WKWebView was not created with the given configuration.&quot;];
</span><span class="cx"> 
</span><span class="cx">     return webView-&gt;_page.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UIClient::runJavaScriptAlert(WebKit::WebPageProxy*, const WTF::String&amp; message, WebKit::WebFrameProxy* webFrameProxy, std::function&lt;void ()&gt; completionHandler)
</del><ins>+void UIDelegate::UIClient::runJavaScriptAlert(WebKit::WebPageProxy*, const WTF::String&amp; message, WebKit::WebFrameProxy* webFrameProxy, std::function&lt;void ()&gt; completionHandler)
</ins><span class="cx"> {
</span><del>-    if (!m_delegateMethods.webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler) {
</del><ins>+    if (!m_uiDelegate.m_delegateMethods.webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler) {
</ins><span class="cx">         completionHandler();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto delegate = m_delegate.get();
</del><ins>+    auto delegate = m_uiDelegate.m_delegate.get();
</ins><span class="cx">     if (!delegate) {
</span><span class="cx">         completionHandler();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [delegate webView:m_webView runJavaScriptAlertPanelWithMessage:message initiatedByFrame:adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*webFrameProxy]).get() completionHandler:[completionHandler] {
</del><ins>+    [delegate webView:m_uiDelegate.m_webView runJavaScriptAlertPanelWithMessage:message initiatedByFrame:adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*webFrameProxy]).get() completionHandler:[completionHandler] {
</ins><span class="cx">         completionHandler();
</span><span class="cx">     }];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UIClient::runJavaScriptConfirm(WebKit::WebPageProxy*, const WTF::String&amp; message, WebKit::WebFrameProxy* webFrameProxy, std::function&lt;void (bool)&gt; completionHandler)
</del><ins>+void UIDelegate::UIClient::runJavaScriptConfirm(WebKit::WebPageProxy*, const WTF::String&amp; message, WebKit::WebFrameProxy* webFrameProxy, std::function&lt;void (bool)&gt; completionHandler)
</ins><span class="cx"> {
</span><del>-    if (!m_delegateMethods.webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler) {
</del><ins>+    if (!m_uiDelegate.m_delegateMethods.webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler) {
</ins><span class="cx">         completionHandler(false);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto delegate = m_delegate.get();
</del><ins>+    auto delegate = m_uiDelegate.m_delegate.get();
</ins><span class="cx">     if (!delegate) {
</span><span class="cx">         completionHandler(false);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [delegate webView:m_webView runJavaScriptConfirmPanelWithMessage:message initiatedByFrame:adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*webFrameProxy]).get() completionHandler:[completionHandler](BOOL result) {
</del><ins>+    [delegate webView:m_uiDelegate.m_webView runJavaScriptConfirmPanelWithMessage:message initiatedByFrame:adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*webFrameProxy]).get() completionHandler:[completionHandler](BOOL result) {
</ins><span class="cx">         completionHandler(result);
</span><span class="cx">     }];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UIClient::runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&amp; message, const WTF::String&amp; defaultValue, WebKit::WebFrameProxy* webFrameProxy, std::function&lt;void (const WTF::String&amp;)&gt; completionHandler)
</del><ins>+void UIDelegate::UIClient::runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&amp; message, const WTF::String&amp; defaultValue, WebKit::WebFrameProxy* webFrameProxy, std::function&lt;void (const WTF::String&amp;)&gt; completionHandler)
</ins><span class="cx"> {
</span><del>-    if (!m_delegateMethods.webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler) {
</del><ins>+    if (!m_uiDelegate.m_delegateMethods.webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler) {
</ins><span class="cx">         completionHandler(String());
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto delegate = m_delegate.get();
</del><ins>+    auto delegate = m_uiDelegate.m_delegate.get();
</ins><span class="cx">     if (!delegate) {
</span><span class="cx">         completionHandler(String());
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [delegate webView:m_webView runJavaScriptTextInputPanelWithPrompt:message defaultText:defaultValue initiatedByFrame:adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*webFrameProxy]).get() completionHandler:[completionHandler](NSString *result) {
</del><ins>+    [delegate webView:m_uiDelegate.m_webView runJavaScriptTextInputPanelWithPrompt:message defaultText:defaultValue initiatedByFrame:adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*webFrameProxy]).get() completionHandler:[completionHandler](NSString *result) {
</ins><span class="cx">         completionHandler(result);
</span><span class="cx">     }];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-RetainPtr&lt;NSArray&gt; UIClient::actionsForElement(_WKActivatedElementInfo *elementInfo, RetainPtr&lt;NSArray&gt; defaultActions)
</del><ins>+RetainPtr&lt;NSArray&gt; UIDelegate::UIClient::actionsForElement(_WKActivatedElementInfo *elementInfo, RetainPtr&lt;NSArray&gt; defaultActions)
</ins><span class="cx"> {
</span><del>-    if (!m_delegateMethods.webViewActionsForElementDefaultActions)
</del><ins>+    if (!m_uiDelegate.m_delegateMethods.webViewActionsForElementDefaultActions)
</ins><span class="cx">         return std::move(defaultActions);
</span><span class="cx"> 
</span><del>-    auto delegate = m_delegate.get();
</del><ins>+    auto delegate = m_uiDelegate.m_delegate.get();
</ins><span class="cx">     if (!delegate)
</span><span class="cx">         return defaultActions;
</span><span class="cx"> 
</span><del>-    return [(id &lt;WKUIDelegatePrivate&gt;)delegate _webView:m_webView actionsForElement:elementInfo defaultActions:defaultActions.get()];
</del><ins>+    return [(id &lt;WKUIDelegatePrivate&gt;)delegate _webView:m_uiDelegate.m_webView actionsForElement:elementInfo defaultActions:defaultActions.get()];
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKActionSheetAssistantmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm (166732 => 166733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm        2014-04-03 18:25:26 UTC (rev 166732)
+++ trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm        2014-04-03 18:34:18 UTC (rev 166733)
</span><span class="lines">@@ -28,15 +28,15 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-#import &quot;_WKActivatedElementInfoInternal.h&quot;
-#import &quot;_WKElementActionInternal.h&quot;
-#import &quot;UIDelegate.h&quot;
</del><ins>+#import &quot;APIUIClient.h&quot;
</ins><span class="cx"> #import &quot;WKActionSheet.h&quot;
</span><span class="cx"> #import &quot;WKContentViewInteraction.h&quot;
</span><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><del>-#import &lt;TCC/TCC.h&gt;
</del><ins>+#import &quot;_WKActivatedElementInfoInternal.h&quot;
+#import &quot;_WKElementActionInternal.h&quot;
</ins><span class="cx"> #import &lt;DataDetectorsUI/DDDetectionController.h&gt;
</span><span class="cx"> #import &lt;SafariServices/SSReadingList.h&gt;
</span><ins>+#import &lt;TCC/TCC.h&gt;
</ins><span class="cx"> #import &lt;UIKit/UIActionSheet_Private.h&gt;
</span><span class="cx"> #import &lt;UIKit/UIView.h&gt;
</span><span class="cx"> #import &lt;UIKit/UIViewController_Private.h&gt;
</span></span></pre>
</div>
</div>

</body>
</html>