Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java

Issue 2803163002: Move address parser and prefixes to android_webview/. (Closed)
Patch Set: Bring back ContentViewStatics import Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java b/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
index b9b83c1d6e709b6e82e27079b2370f0618fdb772..74c3f96876fb3f1a8746e8272de326a6fce86fc7 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
@@ -132,6 +132,21 @@ public class AwContentsStatics {
nativeSetCheckClearTextPermitted(permitted);
}
+ /**
+ * Return the first substring consisting of the address of a physical location.
+ * @see {@link android.webkit.WebView#findAddress(String)}
+ *
+ * @param addr The string to search for addresses.
+ * @return the address, or if no address is found, return null.
+ */
+ public static String findAddress(String addr) {
+ if (addr == null) {
+ throw new NullPointerException("addr is null");
+ }
+ String result = nativeFindAddress(addr);
+ return result == null || result.isEmpty() ? null : result;
+ }
+
//--------------------------------------------------------------------------------------------
// Native methods
//--------------------------------------------------------------------------------------------
@@ -144,4 +159,5 @@ public class AwContentsStatics {
private static native boolean nativeGetSafeBrowsingEnabled();
private static native void nativeSetSafeBrowsingEnabled(boolean enable);
private static native void nativeSetCheckClearTextPermitted(boolean permitted);
+ private static native String nativeFindAddress(String addr);
}

Powered by Google App Engine
This is Rietveld 408576698