Chromium Code Reviews| Index: chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller_helper.cc |
| diff --git a/chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller_helper.cc b/chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller_helper.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b832a5aa090863f03c17e1e141d638189fbe0ddd |
| --- /dev/null |
| +++ b/chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller_helper.cc |
| @@ -0,0 +1,23 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file |
| + |
| +#include "chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller_helper.h" |
| + |
| +#include "base/android/jni_android.h" |
| +#include "base/android/jni_string.h" |
| +#include "chrome/browser/android/tab_android.h" |
| +#include "jni/AutoSigninSnackbarController_jni.h" |
| + |
| +void ShowAutoSigninSnackbar(TabAndroid *tab, const base::string16 &username) { |
|
Miguel Garcia
2015/08/21 10:44:52
same nit abut the & here
melandory
2015/08/21 13:56:21
Done.
|
| + JNIEnv *env = base::android::AttachCurrentThread(); |
| + ScopedJavaLocalRef<jstring> message = |
| + base::android::ConvertUTF16ToJavaString( |
| + env, username); |
| + Java_AutoSigninSnackbarController_showSnackbar( |
| + env, tab->GetJavaObject().obj(), message.obj()); |
| +} |
| + |
| +bool RegisterAutoSigninSnackbarControllerHelper(JNIEnv *env) { |
| + return RegisterNativesImpl(env); |
| +} |