Chromium Code Reviews| Index: chrome/browser/android/signin/signin_promo_util_android.cc |
| diff --git a/chrome/browser/android/signin/signin_promo_util_android.cc b/chrome/browser/android/signin/signin_promo_util_android.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4c95ccde7ab1f7ea910eefbd6c3ef7ca9723bad4 |
| --- /dev/null |
| +++ b/chrome/browser/android/signin/signin_promo_util_android.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2016 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/android/signin/signin_promo_util_android.h" |
| + |
| +#include "base/android/context_utils.h" |
| +#include "base/android/jni_android.h" |
| +#include "jni/SigninPromoUtil_jni.h" |
| +#include "ui/android/window_android.h" |
| + |
| +namespace chrome { |
| +namespace android { |
| + |
| +// static |
| +void SigninPromoUtilAndroid::StartAccountSigninActivityForPromo( |
| + content::ContentViewCore* content_view_core, |
| + signin_metrics::AccessPoint access_point) { |
| + if (content_view_core) { |
| + Java_SigninPromoUtil_openAccountSigninActivityForPromo( |
| + base::android::AttachCurrentThread(), |
| + content_view_core->GetWindowAndroid()->GetJavaObject().obj(), |
|
Ted C
2016/07/19 20:09:19
While reparenting, the window android can be null.
Mathieu
2016/07/19 21:00:19
Done.
|
| + jint(access_point)); |
| + } |
| +} |
| + |
| +// static |
| +bool SigninPromoUtilAndroid::Register(JNIEnv* env) { |
| + return RegisterNativesImpl(env); |
| +} |
| + |
| +} // namespace android |
| +} // namespace chrome |