OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/dom_distiller/dom_distiller_service_factory_android.h" |
| 6 |
| 7 #include "base/android/jni_android.h" |
| 8 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_android.h" |
| 11 #include "components/dom_distiller/core/dom_distiller_service_android.h" |
| 12 #include "jni/DomDistillerServiceFactory_jni.h" |
| 13 |
| 14 using base::android::ScopedJavaLocalRef; |
| 15 |
| 16 namespace dom_distiller { |
| 17 namespace android { |
| 18 |
| 19 jobject DomDistillerServiceFactoryAndroid::GetForProfile(JNIEnv* env, |
| 20 jclass clazz, |
| 21 jobject j_profile) { |
| 22 dom_distiller::DomDistillerService* service = |
| 23 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
| 24 ProfileAndroid::FromProfileAndroid(j_profile)); |
| 25 DomDistillerServiceAndroid* service_android = |
| 26 new DomDistillerServiceAndroid(service); |
| 27 return service_android->java_ref_.obj(); |
| 28 } |
| 29 |
| 30 bool DomDistillerServiceFactoryAndroid::Register(JNIEnv* env) { |
| 31 return RegisterNativesImpl(env); |
| 32 } |
| 33 |
| 34 jobject GetForProfile(JNIEnv* env, jclass clazz, jobject j_profile) { |
| 35 return DomDistillerServiceFactoryAndroid::GetForProfile( |
| 36 env, clazz, j_profile); |
| 37 } |
| 38 |
| 39 } // namespace android |
| 40 } // namespace dom_distiller |
OLD | NEW |