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

Side by Side Diff: chrome/browser/android/signin/account_management_screen_helper.cc

Issue 2801033002: Revert of Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Created 3 years, 8 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
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/context_utils.h"
7 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
9 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_android.h" 11 #include "chrome/browser/profiles/profile_android.h"
11 #include "chrome/browser/profiles/profile_metrics.h" 12 #include "chrome/browser/profiles/profile_metrics.h"
12 #include "jni/AccountManagementScreenHelper_jni.h" 13 #include "jni/AccountManagementScreenHelper_jni.h"
13 14
14 using base::android::JavaParamRef; 15 using base::android::JavaParamRef;
15 16
16 // static 17 // static
17 void AccountManagementScreenHelper::OpenAccountManagementScreen( 18 void AccountManagementScreenHelper::OpenAccountManagementScreen(
18 Profile* profile, 19 Profile* profile,
19 signin::GAIAServiceType service_type) { 20 signin::GAIAServiceType service_type) {
20 DCHECK(profile); 21 DCHECK(profile);
21 DCHECK(ProfileAndroid::FromProfile(profile)); 22 DCHECK(ProfileAndroid::FromProfile(profile));
22 23
23 Java_AccountManagementScreenHelper_openAccountManagementScreen( 24 Java_AccountManagementScreenHelper_openAccountManagementScreen(
24 base::android::AttachCurrentThread(), 25 base::android::AttachCurrentThread(),
26 base::android::GetApplicationContext(),
25 ProfileAndroid::FromProfile(profile)->GetJavaObject(), 27 ProfileAndroid::FromProfile(profile)->GetJavaObject(),
26 static_cast<int>(service_type)); 28 static_cast<int>(service_type));
27 } 29 }
28 30
29 static void LogEvent(JNIEnv* env, 31 static void LogEvent(JNIEnv* env,
30 const JavaParamRef<jclass>& clazz, 32 const JavaParamRef<jclass>& clazz,
31 jint metric, 33 jint metric,
32 jint gaiaServiceType) { 34 jint gaiaServiceType) {
33 ProfileMetrics::LogProfileAndroidAccountManagementMenu( 35 ProfileMetrics::LogProfileAndroidAccountManagementMenu(
34 static_cast<ProfileMetrics::ProfileAndroidAccountManagementMenu>(metric), 36 static_cast<ProfileMetrics::ProfileAndroidAccountManagementMenu>(metric),
35 static_cast<signin::GAIAServiceType>(gaiaServiceType)); 37 static_cast<signin::GAIAServiceType>(gaiaServiceType));
36 } 38 }
37 39
38 // static 40 // static
39 bool AccountManagementScreenHelper::Register(JNIEnv* env) { 41 bool AccountManagementScreenHelper::Register(JNIEnv* env) {
40 return RegisterNativesImpl(env); 42 return RegisterNativesImpl(env);
41 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/android/service_tab_launcher.cc ('k') | chrome/browser/crash_upload_list/crash_upload_list_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698