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/LocaleUtils_jni.h" | 12 #include "jni/LocaleUtils_jni.h" |
13 #include "unicode/uloc.h" | 13 #include "third_party/icu/public/common/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 } |
23 | 23 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 java_display_locale.obj()))); | 86 java_display_locale.obj()))); |
87 return ConvertJavaStringToUTF16(java_result); | 87 return ConvertJavaStringToUTF16(java_result); |
88 } | 88 } |
89 | 89 |
90 bool RegisterLocaleUtils(JNIEnv* env) { | 90 bool RegisterLocaleUtils(JNIEnv* env) { |
91 return RegisterNativesImpl(env); | 91 return RegisterNativesImpl(env); |
92 } | 92 } |
93 | 93 |
94 } // namespace android | 94 } // namespace android |
95 } // namespace base | 95 } // namespace base |
OLD | NEW |