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

Unified Diff: android_webview/native/aw_contents_statics.cc

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
« no previous file with comments | « android_webview/native/address_parser_unittest.cc ('k') | android_webview/renderer/aw_render_frame_ext.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents_statics.cc
diff --git a/android_webview/native/aw_contents_statics.cc b/android_webview/native/aw_contents_statics.cc
index db883d4ea4cc31587c62bd98f56144fbbff65df0..a926232977cb4e6f3b8d1279c8de895e07daf173 100644
--- a/android_webview/native/aw_contents_statics.cc
+++ b/android_webview/native/aw_contents_statics.cc
@@ -8,6 +8,7 @@
#include "android_webview/browser/aw_safe_browsing_config_helper.h"
#include "android_webview/browser/net/aw_url_request_context_getter.h"
#include "android_webview/common/aw_version_info_values.h"
+#include "android_webview/native/address_parser.h"
#include "android_webview/native/aw_contents_io_thread_client_impl.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
@@ -106,6 +107,18 @@ void SetCheckClearTextPermitted(JNIEnv* env,
AwURLRequestContextGetter::set_check_cleartext_permitted(permitted);
}
+// static
+ScopedJavaLocalRef<jstring> FindAddress(JNIEnv* env,
+ const JavaParamRef<jclass>& clazz,
+ const JavaParamRef<jstring>& addr) {
+ base::string16 content_16 =
+ base::android::ConvertJavaStringToUTF16(env, addr);
+ base::string16 result_16;
+ if (android_webview::address_parser::FindAddress(content_16, &result_16))
+ return base::android::ConvertUTF16ToJavaString(env, result_16);
+ return ScopedJavaLocalRef<jstring>();
+}
+
bool RegisterAwContentsStatics(JNIEnv* env) {
return RegisterNativesImpl(env);
}
« no previous file with comments | « android_webview/native/address_parser_unittest.cc ('k') | android_webview/renderer/aw_render_frame_ext.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698