OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/android/locale_utils.h" | 5 #include "base/android/locale_utils.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "jni/locale_utils_jni.h" | 12 #include "jni/LocaleUtils_jni.h" |
13 #include "unicode/uloc.h" | 13 #include "unicode/uloc.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 namespace android { | 16 namespace android { |
17 | 17 |
18 std::string GetDefaultLocale() { | 18 std::string GetDefaultLocale() { |
19 JNIEnv* env = AttachCurrentThread(); | 19 JNIEnv* env = AttachCurrentThread(); |
20 ScopedJavaLocalRef<jstring> locale = Java_LocaleUtils_getDefaultLocale(env); | 20 ScopedJavaLocalRef<jstring> locale = Java_LocaleUtils_getDefaultLocale(env); |
21 return ConvertJavaStringToUTF8(locale); | 21 return ConvertJavaStringToUTF8(locale); |
22 } | 22 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 java_display_locale.obj()))); | 85 java_display_locale.obj()))); |
86 return ConvertJavaStringToUTF16(java_result); | 86 return ConvertJavaStringToUTF16(java_result); |
87 } | 87 } |
88 | 88 |
89 bool RegisterLocaleUtils(JNIEnv* env) { | 89 bool RegisterLocaleUtils(JNIEnv* env) { |
90 return RegisterNativesImpl(env); | 90 return RegisterNativesImpl(env); |
91 } | 91 } |
92 | 92 |
93 } // namespace android | 93 } // namespace android |
94 } // namespace base | 94 } // namespace base |
OLD | NEW |