Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: chrome/browser/ui/android/snackbars/auto_signin_snackbar_controller.cc

Issue 1234063002: [Smart Lock] Auto sign-in snackbar UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on top of master Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 AutoSigninSnackbarController::AutoSigninSnackbarController(TabAndroid *tab) {
13 JNIEnv *env = base::android::AttachCurrentThread();
14 java_snackbar_controller_.Reset(Java_AutoSigninSnackbarController_create(
15 env, tab->GetJavaObject().obj(), reinterpret_cast<intptr_t>(this)));
16 }
17
18 AutoSigninSnackbarController::~AutoSigninSnackbarController() {}
19
20 void AutoSigninSnackbarController::onShow(const base::string16 &username) {
21 JNIEnv *env = base::android::AttachCurrentThread();
22 Java_AutoSigninSnackbarController_show(
23 env, java_snackbar_controller_.obj(),
24 base::android::ConvertUTF16ToJavaString(env, username).obj());
25 }
26
27 void AutoSigninSnackbarController::Destroy(JNIEnv *env, jobject obj) {
28 delete this;
29 }
30
31 bool RegisterAutoSigninSnackbarController(JNIEnv *env) {
32 return RegisterNativesImpl(env);
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698