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