Title: [164315] trunk/Source/WebKit2
Revision
164315
Author
ander...@apple.com
Date
2014-02-18 14:23:13 -0800 (Tue, 18 Feb 2014)

Log Message

Add SPI for getting the original URL from a WKNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=128997

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKNavigationActionInternal.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (164314 => 164315)


--- trunk/Source/WebKit2/ChangeLog	2014-02-18 22:08:45 UTC (rev 164314)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-18 22:23:13 UTC (rev 164315)
@@ -1,5 +1,18 @@
 2014-02-18  Anders Carlsson  <ander...@apple.com>
 
+        Add SPI for getting the original URL from a WKNavigationAction
+        https://bugs.webkit.org/show_bug.cgi?id=128997
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
+        * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h.
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2014-02-18  Anders Carlsson  <ander...@apple.com>
+
         Add more WKWebView SPI
         https://bugs.webkit.org/show_bug.cgi?id=128994
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h (164314 => 164315)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h	2014-02-18 22:08:45 UTC (rev 164314)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h	2014-02-18 22:23:13 UTC (rev 164315)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKNavigationAction.h"
+#import "WKNavigationActionPrivate.h"
 
 #if WK_API_ENABLED
 
@@ -35,6 +35,8 @@
 @property (nonatomic, readwrite) WKNavigationType navigationType;
 @property (nonatomic, readwrite, copy) NSURLRequest *request;
 
+@property (nonatomic, readwrite, copy, setter=_setOriginalURL:) NSURL *_originalURL;
+
 @end
 
 #endif

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionPrivate.h (from rev 164313, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h) (0 => 164315)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionPrivate.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionPrivate.h	2014-02-18 22:23:13 UTC (rev 164315)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit2/WKNavigationAction.h>
+
+#if WK_API_ENABLED
+
+@interface WKNavigationAction (WKPrivate)
+
+@property (nonatomic, readonly) NSURL *_originalURL;
+
+@end
+
+#endif

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (164314 => 164315)


--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-02-18 22:08:45 UTC (rev 164314)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-02-18 22:23:13 UTC (rev 164315)
@@ -254,6 +254,7 @@
 
     [navigationAction setNavigationType:toWKNavigationType(navigationActionData.navigationType)];
     [navigationAction setRequest:request.nsURLRequest(WebCore::DoNotUpdateHTTPBody)];
+    [navigationAction _setOriginalURL:originalRequest.url()];
 
     [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:navigationAction.get() decisionHandler:[listener](WKNavigationPolicyDecision policyDecision) {
         switch (policyDecision) {

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (164314 => 164315)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-02-18 22:08:45 UTC (rev 164314)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-02-18 22:23:13 UTC (rev 164315)
@@ -370,6 +370,7 @@
 		1AF05D8714688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */; };
 		1AF1AC6B1651759E00C17D7F /* RemoteLayerTreeTransaction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */; };
 		1AF1AC6C1651759E00C17D7F /* RemoteLayerTreeTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */; };
+		1AF4129B18B40FCD00546FDC /* WKNavigationActionPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF4129A18B40FCD00546FDC /* WKNavigationActionPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AFDD3151891B54000153970 /* APIPolicyClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFDD3141891B54000153970 /* APIPolicyClient.h */; };
 		1AFDD3171891C94700153970 /* WKPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFDD3161891C94700153970 /* WKPreferences.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AFDD3191891CA1200153970 /* WKPreferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFDD3181891CA1200153970 /* WKPreferences.mm */; };
@@ -1442,7 +1443,6 @@
 		ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		EDCA71B7128DDA8C00201B26 /* WKBundlePageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A22F1001289FCD90085E74F /* WKBundlePageOverlay.cpp */; };
 		F036978815F4BF0500C3A80E /* WebColorPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F036978715F4BF0500C3A80E /* WebColorPicker.cpp */; };
-		F036978B15F4BF1300C3A80E /* WebColorPickerResultListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F036978915F4BF1300C3A80E /* WebColorPickerResultListenerProxy.cpp */; };
 		F6113E25126CE1820057D0A7 /* WebUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = F6113E24126CE1820057D0A7 /* WebUserContentURLPattern.h */; };
 		F6113E28126CE19B0057D0A7 /* WKUserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6113E26126CE19B0057D0A7 /* WKUserContentURLPattern.cpp */; };
 		F6113E29126CE19B0057D0A7 /* WKUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = F6113E27126CE19B0057D0A7 /* WKUserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2056,6 +2056,7 @@
 		1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TiledCoreAnimationDrawingAreaProxy.h; sourceTree = "<group>"; };
 		1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeTransaction.mm; sourceTree = "<group>"; };
 		1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeTransaction.h; sourceTree = "<group>"; };
+		1AF4129A18B40FCD00546FDC /* WKNavigationActionPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationActionPrivate.h; sourceTree = "<group>"; };
 		1AFDD3141891B54000153970 /* APIPolicyClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIPolicyClient.h; sourceTree = "<group>"; };
 		1AFDD3161891C94700153970 /* WKPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferences.h; sourceTree = "<group>"; };
 		1AFDD3181891CA1200153970 /* WKPreferences.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKPreferences.mm; sourceTree = "<group>"; };
@@ -4365,6 +4366,7 @@
 				1A256E3618A1A788006FB922 /* WKNavigationAction.h */,
 				1A256E3518A1A788006FB922 /* WKNavigationAction.mm */,
 				1A256E3918A1A7DF006FB922 /* WKNavigationActionInternal.h */,
+				1AF4129A18B40FCD00546FDC /* WKNavigationActionPrivate.h */,
 				1ABC3DFB1899F51C004F0626 /* WKNavigationDelegate.h */,
 				1AA20D5018AD50E0005D1ED4 /* WKNavigationDelegatePrivate.h */,
 				1ABC3DF01899C6B6004F0626 /* WKNavigationInternal.h */,
@@ -6518,6 +6520,7 @@
 				2DA944871884E3B500ED86DB /* PageClientImplIOS.h in Headers */,
 				1AD3306F16B1D991004F60E7 /* StorageAreaImpl.h in Headers */,
 				1A4D664E18A3031B00D82E21 /* WKFrameInfoInternal.h in Headers */,
+				1AF4129B18B40FCD00546FDC /* WKNavigationActionPrivate.h in Headers */,
 				1ACECD2517162DB1001FC9EF /* StorageAreaMap.h in Headers */,
 				1A334DEE16DE8F88006A8E38 /* StorageAreaMapMessages.h in Headers */,
 				1A44B95C16B73F9F00B7BBD8 /* StorageManager.h in Headers */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to