diff options
author | Ben Murdoch <benm@google.com> | 2010-10-19 19:41:46 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-29 13:01:59 +0100 |
commit | 0c1d1cdabd0d3bb762788ac04f9d6784c0b3f848 (patch) | |
tree | edaeb6a139ae5f0a3fe0f82d59c9d8ed3f13d4fc /android/jni | |
parent | 8e09e68598f6ccf165ed90c86ba3a707069fae7c (diff) | |
download | external_chromium-0c1d1cdabd0d3bb762788ac04f9d6784c0b3f848.zip external_chromium-0c1d1cdabd0d3bb762788ac04f9d6784c0b3f848.tar.gz external_chromium-0c1d1cdabd0d3bb762788ac04f9d6784c0b3f848.tar.bz2 |
Implement l10n_util functions needed for AutoFill previews.
Generating an autofill preview uses localisation strings to
work out how the preview should be formatted appropriate for
the current users locale. On Android, call through JNI and
look up the relevant string from the resources file.
Change-Id: I74158278757d88cfeab407c13e69e6f4cf138630
Diffstat (limited to 'android/jni')
-rw-r--r-- | android/jni/jni_utils.cc | 6 | ||||
-rw-r--r-- | android/jni/jni_utils.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/android/jni/jni_utils.cc b/android/jni/jni_utils.cc index 5e391c1..ceb0777 100644 --- a/android/jni/jni_utils.cc +++ b/android/jni/jni_utils.cc @@ -20,6 +20,7 @@ JNIEnv* getJNIEnv(); // WebCoreJni.h namespace android { std::string jstringToStdString(JNIEnv* env, jstring jstr); +string16 jstringToString16(JNIEnv* env, jstring jstr); } namespace android { @@ -32,5 +33,10 @@ std::string JstringToStdString(JNIEnv* env, jstring jstr) { return jstringToStdString(env, jstr); } +string16 JstringToString16(JNIEnv* env, jstring jstr) +{ + return jstringToString16(env, jstr); +} + } // namespace android diff --git a/android/jni/jni_utils.h b/android/jni/jni_utils.h index 28cd11b..f45de7a 100644 --- a/android/jni/jni_utils.h +++ b/android/jni/jni_utils.h @@ -4,6 +4,7 @@ #include <string> +#include "base/string16.h" #include "nativehelper/jni.h" namespace android { @@ -14,5 +15,7 @@ JNIEnv* GetJNIEnv(); // Convert Java String to std::string. On null input, returns an empty string. std::string JstringToStdString(JNIEnv* env, jstring jstr); +string16 JstringToString16(JNIEnv* env, jstring jstr); + } // namespace android |