| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/signin/account_management_screen_helper.h" | 5 #include "chrome/browser/android/signin/account_management_screen_helper.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_android.h" | 10 #include "chrome/browser/profiles/profile_android.h" |
| 11 #include "chrome/browser/profiles/profile_metrics.h" |
| 11 #include "jni/AccountManagementScreenHelper_jni.h" | 12 #include "jni/AccountManagementScreenHelper_jni.h" |
| 12 | 13 |
| 13 // static | 14 // static |
| 14 void AccountManagementScreenHelper::OpenAccountManagementScreen( | 15 void AccountManagementScreenHelper::OpenAccountManagementScreen( |
| 15 Profile* profile) { | 16 Profile* profile, |
| 17 signin::GAIAServiceType service_type) { |
| 16 DCHECK(profile); | 18 DCHECK(profile); |
| 17 DCHECK(ProfileAndroid::FromProfile(profile)); | 19 DCHECK(ProfileAndroid::FromProfile(profile)); |
| 18 | 20 |
| 19 Java_AccountManagementScreenHelper_openAccountManagementScreen( | 21 Java_AccountManagementScreenHelper_openAccountManagementScreen( |
| 20 base::android::AttachCurrentThread(), | 22 base::android::AttachCurrentThread(), |
| 21 base::android::GetApplicationContext(), | 23 base::android::GetApplicationContext(), |
| 22 ProfileAndroid::FromProfile(profile)->GetJavaObject().obj()); | 24 ProfileAndroid::FromProfile(profile)->GetJavaObject().obj(), |
| 25 static_cast<int>(service_type)); |
| 26 } |
| 27 |
| 28 static void LogEvent(JNIEnv* env, |
| 29 jclass clazz, |
| 30 jint metric, |
| 31 jint gaiaServiceType) { |
| 32 ProfileMetrics::LogProfileAndroidAccountManagementMenu( |
| 33 static_cast<ProfileMetrics::ProfileAndroidAccountManagementMenu>(metric), |
| 34 static_cast<signin::GAIAServiceType>(gaiaServiceType)); |
| 23 } | 35 } |
| 24 | 36 |
| 25 // static | 37 // static |
| 26 bool AccountManagementScreenHelper::Register(JNIEnv* env) { | 38 bool AccountManagementScreenHelper::Register(JNIEnv* env) { |
| 27 return RegisterNativesImpl(env); | 39 return RegisterNativesImpl(env); |
| 28 } | 40 } |
| OLD | NEW |