| 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 "ui/base/l10n/l10n_util_android.h" | 5 #include "ui/base/l10n/l10n_util_android.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "jni/LocalizationUtils_jni.h" | 16 #include "jni/LocalizationUtils_jni.h" |
| 17 #include "third_party/icu/source/common/unicode/uloc.h" | 17 #include "third_party/icu/source/common/unicode/uloc.h" |
| 18 #include "ui/base/l10n/time_format.h" | 18 #include "ui/base/l10n/time_format.h" |
| 19 | 19 |
| 20 using base::android::JavaParamRef; |
| 21 using base::android::ScopedJavaLocalRef; |
| 22 |
| 20 namespace l10n_util { | 23 namespace l10n_util { |
| 21 | 24 |
| 22 jint GetFirstStrongCharacterDirection(JNIEnv* env, | 25 jint GetFirstStrongCharacterDirection(JNIEnv* env, |
| 23 const JavaParamRef<jclass>& clazz, | 26 const JavaParamRef<jclass>& clazz, |
| 24 const JavaParamRef<jstring>& string) { | 27 const JavaParamRef<jstring>& string) { |
| 25 return base::i18n::GetFirstStrongCharacterDirection( | 28 return base::i18n::GetFirstStrongCharacterDirection( |
| 26 base::android::ConvertJavaStringToUTF16(env, string)); | 29 base::android::ConvertJavaStringToUTF16(env, string)); |
| 27 } | 30 } |
| 28 | 31 |
| 29 bool IsLayoutRtl() { | 32 bool IsLayoutRtl() { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 ui::TimeFormat::FORMAT_REMAINING, ui::TimeFormat::LENGTH_SHORT, | 108 ui::TimeFormat::FORMAT_REMAINING, ui::TimeFormat::LENGTH_SHORT, |
| 106 base::TimeDelta::FromMilliseconds(timeInMillis))); | 109 base::TimeDelta::FromMilliseconds(timeInMillis))); |
| 107 return jtime_remaining; | 110 return jtime_remaining; |
| 108 } | 111 } |
| 109 | 112 |
| 110 bool RegisterLocalizationUtil(JNIEnv* env) { | 113 bool RegisterLocalizationUtil(JNIEnv* env) { |
| 111 return RegisterNativesImpl(env); | 114 return RegisterNativesImpl(env); |
| 112 } | 115 } |
| 113 | 116 |
| 114 } // namespace l10n_util | 117 } // namespace l10n_util |
| OLD | NEW |