| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/blimp/blimp_client_context_factory_android.h" | 5 #include "chrome/browser/android/blimp/blimp_client_context_factory_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "blimp/client/public/blimp_client_context.h" | 9 #include "blimp/client/public/blimp_client_context.h" |
| 10 #include "chrome/browser/android/blimp/blimp_client_context_factory.h" | 10 #include "chrome/browser/android/blimp/blimp_client_context_factory.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_android.h" | 12 #include "chrome/browser/profiles/profile_android.h" |
| 13 #include "jni/BlimpClientContextFactory_jni.h" | 13 #include "jni/BlimpClientContextFactory_jni.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class BrowserContext; | 16 class BrowserContext; |
| 17 } | 17 } |
| 18 | 18 |
| 19 static base::android::ScopedJavaLocalRef<jobject> | 19 static base::android::ScopedJavaLocalRef<jobject> |
| 20 GetBlimpClientContextForProfile(JNIEnv* env, | 20 GetBlimpClientContextForProfile(JNIEnv* env, |
| 21 const JavaParamRef<jclass>& clazz, | 21 const JavaParamRef<jclass>& clazz, |
| 22 const JavaParamRef<jobject>& jprofile) { | 22 const JavaParamRef<jobject>& jprofile) { |
| 23 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); | 23 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); |
| 24 DCHECK(profile); | 24 DCHECK(profile); |
| 25 return BlimpClientContextFactory::GetInstance() | 25 return blimp::client::BlimpClientContext::GetJavaObject( |
| 26 ->GetForBrowserContext(profile) | 26 BlimpClientContextFactory::GetInstance()->GetForBrowserContext(profile)); |
| 27 ->GetJavaObject(); | |
| 28 } | 27 } |
| 29 | 28 |
| 30 bool RegisterBlimpClientContextFactoryJni(JNIEnv* env) { | 29 bool RegisterBlimpClientContextFactoryJni(JNIEnv* env) { |
| 31 return RegisterNativesImpl(env); | 30 return RegisterNativesImpl(env); |
| 32 } | 31 } |
| OLD | NEW |