You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/05/29 01:24:19 UTC
ios commit: Added CDVURLRequestFilter Protocol (which can be used by
plugins. It's used by cordova-plugin-whitelist)
Repository: cordova-ios
Updated Branches:
refs/heads/4.0.x d175d3f0b -> d75be3669
Added CDVURLRequestFilter Protocol (which can be used by plugins. It's used by cordova-plugin-whitelist)
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/d75be366
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/d75be366
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/d75be366
Branch: refs/heads/4.0.x
Commit: d75be366980f6ca2a14290c9870b8f8ffa47be77
Parents: d175d3f
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu May 28 16:25:40 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu May 28 16:25:40 2015 -0700
----------------------------------------------------------------------
CordovaLib/Classes/Public/CDV.h | 1 +
CordovaLib/Classes/Public/CDVURLRequestFilter.h | 27 ++++++++++++++++++++
CordovaLib/Classes/Public/CDVViewController.h | 3 ++-
CordovaLib/CordovaLib.xcodeproj/project.pbxproj | 4 +++
4 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/d75be366/CordovaLib/Classes/Public/CDV.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDV.h b/CordovaLib/Classes/Public/CDV.h
index bfc3e44..d655a10 100644
--- a/CordovaLib/Classes/Public/CDV.h
+++ b/CordovaLib/Classes/Public/CDV.h
@@ -32,3 +32,4 @@
#import "CDVScreenOrientationDelegate.h"
#import "CDVTimer.h"
#import "CDVUserAgentUtil.h"
+#import "CDVURLRequestFilter.h"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/d75be366/CordovaLib/Classes/Public/CDVURLRequestFilter.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVURLRequestFilter.h b/CordovaLib/Classes/Public/CDVURLRequestFilter.h
new file mode 100644
index 0000000..8a0318b
--- /dev/null
+++ b/CordovaLib/Classes/Public/CDVURLRequestFilter.h
@@ -0,0 +1,27 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+@protocol CDVURLRequestFilter <NSObject>
+
+@optional
+- (BOOL)shouldAllowNavigationToURL:(NSURL *)url;
+- (BOOL)shouldAllowRequestForURL:(NSURL *)url;
+- (BOOL)shouldOpenExternalURL:(NSURL*)url;
+
+@end
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/d75be366/CordovaLib/Classes/Public/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVViewController.h b/CordovaLib/Classes/Public/CDVViewController.h
index 023d8e2..ba7e446 100644
--- a/CordovaLib/Classes/Public/CDVViewController.h
+++ b/CordovaLib/Classes/Public/CDVViewController.h
@@ -26,8 +26,9 @@
#import "CDVScreenOrientationDelegate.h"
#import "CDVPlugin.h"
#import "CDVWebViewEngineProtocol.h"
+#import "CDVURLRequestFilter.h"
-@interface CDVViewController : UIViewController <CDVScreenOrientationDelegate>{
+@interface CDVViewController : UIViewController <CDVScreenOrientationDelegate, CDVURLRequestFilter >{
@protected
id <CDVWebViewEngineProtocol> _webViewEngine;
@protected
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/d75be366/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 9502873..5e18bae 100644
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -59,6 +59,7 @@
7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; };
+ 7EDCF3001B17D9DF00F7019F /* CDVURLRequestFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EDCF2FF1B17D9DF00F7019F /* CDVURLRequestFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -116,6 +117,7 @@
7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CordovaPreferences.m"; sourceTree = "<group>"; };
7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
+ 7EDCF2FF1B17D9DF00F7019F /* CDVURLRequestFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVURLRequestFilter.h; sourceTree = "<group>"; };
AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CordovaLib_Prefix.pch; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
@@ -253,6 +255,7 @@
7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */,
7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */,
7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */,
+ 7EDCF2FF1B17D9DF00F7019F /* CDVURLRequestFilter.h */,
);
name = Public;
path = Classes/Public;
@@ -286,6 +289,7 @@
7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */,
7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */,
7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */,
+ 7EDCF3001B17D9DF00F7019F /* CDVURLRequestFilter.h in Headers */,
7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */,
7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */,
7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org