Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include <jni.h> | |
| 6 | |
| 7 #include "base/android/jni_android.h" | |
| 8 #include "base/android/jni_string.h" | |
| 9 #include "base/android/scoped_java_ref.h" | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/logging.h" | |
| 12 #include "content/browser/android/content_view_statics.h" | |
| 13 #include "content/common/android/address_parser.h" | |
| 14 #include "jni/content_view_statics_jni.h" | |
| 15 | |
| 16 using base::android::ConvertJavaStringToUTF16; | |
| 17 using base::android::ConvertUTF16ToJavaString; | |
| 18 using base::android::ScopedJavaLocalRef; | |
| 19 using namespace content::address_parser; | |
|
John Grabowski
2012/06/28 17:08:06
chrome style doesn't like "using namespace". List
aurimas (slooooooooow)
2012/06/28 23:00:07
Done.
| |
| 20 | |
| 21 static jstring FindAddress(JNIEnv* env, jclass clazz, jstring addr) { | |
|
John Grabowski
2012/06/28 17:08:06
chrome style prefers anon namespaces to static fun
aurimas (slooooooooow)
2012/06/28 23:00:07
I tried putting this function in a anon namespace,
| |
| 22 string16 content_16 = ConvertJavaStringToUTF16(env, addr); | |
| 23 string16 result_16; | |
| 24 if (FindAddress(content_16, &result_16)) | |
| 25 return ConvertUTF16ToJavaString(env, result_16).Release(); | |
| 26 return NULL; | |
| 27 } | |
| 28 | |
| 29 bool RegisterWebViewStatics(JNIEnv* env) { | |
|
John Grabowski
2012/06/28 17:08:06
all in content napespace
aurimas (slooooooooow)
2012/06/28 23:00:07
Done.
| |
| 30 return RegisterNativesImpl(env) >= 0; | |
| 31 } | |
| OLD | NEW |