Chromium Code Reviews| 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 "base/android/jni_string.h" | |
|
nyquist
2014/07/09 23:49:04
Nit: is this needed?
sunangel
2014/07/10 14:31:52
Done.
| |
| 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | |
|
nyquist
2014/07/09 23:49:04
Nit: is this needed?
sunangel
2014/07/10 14:31:52
Yes.
On 2014/07/09 23:49:04, nyquist wrote:
| |
| 11 #include "chrome/browser/profiles/profile_android.h" | |
| 12 #include "components/dom_distiller/core/dom_distiller_service_android.h" | |
| 13 #include "jni/DomDistillerServiceFactory_jni.h" | |
| 14 | |
| 15 using base::android::ScopedJavaLocalRef; | |
| 16 | |
| 17 namespace dom_distiller { | |
| 18 namespace android { | |
| 19 | |
| 20 jobject DomDistillerServiceFactoryAndroid::GetForProfile(JNIEnv* env, | |
| 21 jclass clazz, | |
| 22 jobject j_profile) { | |
| 23 dom_distiller::DomDistillerService* service = | |
| 24 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( | |
| 25 ProfileAndroid::FromProfileAndroid(j_profile)); | |
| 26 DomDistillerServiceAndroid* service_android = | |
| 27 new DomDistillerServiceAndroid(service); | |
| 28 return service_android->java_ref_.obj(); | |
| 29 } | |
| 30 | |
| 31 bool DomDistillerServiceFactoryAndroid::Register(JNIEnv* env) { | |
| 32 return RegisterNativesImpl(env); | |
| 33 } | |
| 34 | |
| 35 jobject GetForProfile(JNIEnv* env, jclass clazz, jobject j_profile) { | |
| 36 return DomDistillerServiceFactoryAndroid::GetForProfile( | |
| 37 env, clazz, j_profile); | |
| 38 } | |
| 39 | |
| 40 } // namespace android | |
| 41 } // namespace dom_distiller | |
| OLD | NEW |