OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller.h" | |
6 | |
7 #include "base/android/jni_android.h" | |
8 #include "base/android/jni_string.h" | |
9 #include "chrome/browser/android/tab_android.h" | |
10 #include "chrome/grit/generated_resources.h" | |
11 #include "jni/AutoSigninSnackbarController_jni.h" | |
12 #include "ui/base/l10n/l10n_util.h" | |
13 | |
14 void ShowAutoSigninSnackbar(TabAndroid *tab, const base::string16& username) { | |
15 JNIEnv *env = base::android::AttachCurrentThread(); | |
16 ScopedJavaLocalRef<jstring> message = base::android::ConvertUTF16ToJavaString( | |
17 env, l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, | |
18 username)); | |
19 Java_AutoSigninSnackbarController_showSnackbar( | |
20 env, tab->GetJavaObject().obj(), message.obj()); | |
21 } | |
22 | |
23 bool RegisterAutoSigninSnackbarController(JNIEnv *env) { | |
24 return RegisterNativesImpl(env); | |
25 } | |
OLD | NEW |