| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller.h" | 5 #include "chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller.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 "chrome/browser/android/tab_android.h" | 9 #include "chrome/browser/android/tab_android.h" |
| 10 #include "chrome/grit/generated_resources.h" |
| 10 #include "jni/AutoSigninSnackbarController_jni.h" | 11 #include "jni/AutoSigninSnackbarController_jni.h" |
| 12 #include "ui/base/l10n/l10n_util.h" |
| 11 | 13 |
| 12 void ShowAutoSigninSnackbar(TabAndroid *tab, const base::string16& username) { | 14 void ShowAutoSigninSnackbar(TabAndroid *tab, const base::string16& username) { |
| 13 JNIEnv *env = base::android::AttachCurrentThread(); | 15 JNIEnv *env = base::android::AttachCurrentThread(); |
| 14 ScopedJavaLocalRef<jstring> message = | 16 ScopedJavaLocalRef<jstring> message = base::android::ConvertUTF16ToJavaString( |
| 15 base::android::ConvertUTF16ToJavaString( | 17 env, l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, |
| 16 env, username); | 18 username)); |
| 17 Java_AutoSigninSnackbarController_showSnackbar( | 19 Java_AutoSigninSnackbarController_showSnackbar( |
| 18 env, tab->GetJavaObject().obj(), message.obj()); | 20 env, tab->GetJavaObject().obj(), message.obj()); |
| 19 } | 21 } |
| 20 | 22 |
| 21 bool RegisterAutoSigninSnackbarController(JNIEnv *env) { | 23 bool RegisterAutoSigninSnackbarController(JNIEnv *env) { |
| 22 return RegisterNativesImpl(env); | 24 return RegisterNativesImpl(env); |
| 23 } | 25 } |
| OLD | NEW |