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 "jni/AutoSigninSnackbarController_jni.h" |
| 11 |
| 12 void ShowAutoSigninSnackbar(TabAndroid *tab, const base::string16& username) { |
| 13 JNIEnv *env = base::android::AttachCurrentThread(); |
| 14 ScopedJavaLocalRef<jstring> message = |
| 15 base::android::ConvertUTF16ToJavaString( |
| 16 env, username); |
| 17 Java_AutoSigninSnackbarController_showSnackbar( |
| 18 env, tab->GetJavaObject().obj(), message.obj()); |
| 19 } |
| 20 |
| 21 bool RegisterAutoSigninSnackbarController(JNIEnv *env) { |
| 22 return RegisterNativesImpl(env); |
| 23 } |
OLD | NEW |