| 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 "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/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 env, | 86 env, |
| 87 java_locale.obj(), | 87 java_locale.obj(), |
| 88 java_display_locale.obj())); | 88 java_display_locale.obj())); |
| 89 return ConvertJavaStringToUTF16(java_result); | 89 return ConvertJavaStringToUTF16(java_result); |
| 90 } | 90 } |
| 91 | 91 |
| 92 jstring GetDurationString(JNIEnv* env, jclass clazz, jlong timeInMillis) { | 92 jstring GetDurationString(JNIEnv* env, jclass clazz, jlong timeInMillis) { |
| 93 ScopedJavaLocalRef<jstring> jtime_remaining = | 93 ScopedJavaLocalRef<jstring> jtime_remaining = |
| 94 base::android::ConvertUTF16ToJavaString( | 94 base::android::ConvertUTF16ToJavaString( |
| 95 env, | 95 env, |
| 96 ui::TimeFormat::TimeRemaining( | 96 ui::TimeFormat::Simple( |
| 97 ui::TimeFormat::FORMAT_REMAINING, ui::TimeFormat::LENGTH_SHORT, |
| 97 base::TimeDelta::FromMilliseconds(timeInMillis))); | 98 base::TimeDelta::FromMilliseconds(timeInMillis))); |
| 98 return jtime_remaining.Release(); | 99 return jtime_remaining.Release(); |
| 99 } | 100 } |
| 100 | 101 |
| 101 bool RegisterLocalizationUtil(JNIEnv* env) { | 102 bool RegisterLocalizationUtil(JNIEnv* env) { |
| 102 return RegisterNativesImpl(env); | 103 return RegisterNativesImpl(env); |
| 103 } | 104 } |
| 104 | 105 |
| 105 } // namespace l10n_util | 106 } // namespace l10n_util |
| OLD | NEW |