Chromium Code Reviews| Index: chrome/browser/profiles/profile_android.cc |
| diff --git a/chrome/browser/profiles/profile_android.cc b/chrome/browser/profiles/profile_android.cc |
| index 0496675c2e0219ca1465a71a5121f4425a370b82..47c55f204efc49f1086c8bca118fe2a17d9285e6 100644 |
| --- a/chrome/browser/profiles/profile_android.cc |
| +++ b/chrome/browser/profiles/profile_android.cc |
| @@ -63,6 +63,35 @@ jobject ProfileAndroid::GetLastUsedProfile(JNIEnv* env, jclass clazz) { |
| return profile_android->obj_.obj(); |
| } |
| +base::android::ScopedJavaLocalRef<jobject> |
| +ProfileAndroid::GetOffTheRecordProfile(JNIEnv* env, jobject obj) { |
| + Profile* profile = ProfileManager::GetPrimaryUserProfile(); |
|
Ted C
2014/09/10 17:08:10
This shouldn't be using this anymore. It should b
Maria
2014/09/10 17:17:54
Done.
|
| + if (!profile) { |
| + NOTREACHED() << "Profile not found."; |
| + return base::android::ScopedJavaLocalRef<jobject>(); |
| + } |
| + |
| + Profile* otr_profile = profile->GetOffTheRecordProfile(); |
| + DCHECK(otr_profile); |
| + |
| + ProfileAndroid* profile_android = ProfileAndroid::FromProfile(otr_profile); |
| + if (!profile_android) { |
| + NOTREACHED() << "ProfileAndroid not found."; |
| + return base::android::ScopedJavaLocalRef<jobject>(); |
| + } |
| + return profile_android->GetJavaObject(); |
| +} |
| + |
| +jboolean ProfileAndroid::HasOffTheRecordProfile(JNIEnv* env, jobject obj) { |
| + Profile* profile = ProfileManager::GetPrimaryUserProfile(); |
| + if (!profile) { |
| + NOTREACHED() << "Profile not found."; |
| + return false; |
| + } |
| + |
| + return profile->HasOffTheRecordProfile(); |
|
Ted C
2014/09/10 17:08:10
and this should be profile_->HasOffTheRecordProfil
Maria
2014/09/10 17:17:54
Done.
|
| +} |
| + |
| // static |
| jobject GetLastUsedProfile(JNIEnv* env, jclass clazz) { |
| return ProfileAndroid::GetLastUsedProfile(env, clazz); |
| @@ -74,7 +103,6 @@ ProfileAndroid::ProfileAndroid(Profile* profile) |
| base::android::ScopedJavaLocalRef<jobject> jprofile = |
| Java_Profile_create(env, reinterpret_cast<intptr_t>(this)); |
| obj_.Reset(env, jprofile.obj()); |
| - |
| } |
| ProfileAndroid::~ProfileAndroid() { |