| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 env, | 100 env, |
| 101 java_locale.obj(), | 101 java_locale.obj(), |
| 102 java_display_locale.obj())); | 102 java_display_locale.obj())); |
| 103 return ConvertJavaStringToUTF16(java_result); | 103 return ConvertJavaStringToUTF16(java_result); |
| 104 } | 104 } |
| 105 | 105 |
| 106 jstring GetDurationString(JNIEnv* env, jclass clazz, jlong timeInMillis) { | 106 jstring GetDurationString(JNIEnv* env, jclass clazz, jlong timeInMillis) { |
| 107 ScopedJavaLocalRef<jstring> jtime_remaining = | 107 ScopedJavaLocalRef<jstring> jtime_remaining = |
| 108 base::android::ConvertUTF16ToJavaString( | 108 base::android::ConvertUTF16ToJavaString( |
| 109 env, | 109 env, |
| 110 ui::TimeFormat::TimeRemaining( | 110 ui::TimeFormat::Simple( |
| 111 ui::TimeFormat::FORMAT_REMAINING, ui::TimeFormat::LENGTH_SHORT, |
| 111 base::TimeDelta::FromMilliseconds(timeInMillis))); | 112 base::TimeDelta::FromMilliseconds(timeInMillis))); |
| 112 return jtime_remaining.Release(); | 113 return jtime_remaining.Release(); |
| 113 } | 114 } |
| 114 | 115 |
| 115 bool RegisterLocalizationUtil(JNIEnv* env) { | 116 bool RegisterLocalizationUtil(JNIEnv* env) { |
| 116 return RegisterNativesImpl(env); | 117 return RegisterNativesImpl(env); |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace l10n_util | 120 } // namespace l10n_util |
| OLD | NEW |