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 "components/dom_distiller/core/dom_distiller_service_android.h" |
| 6 |
| 7 #include "base/android/jni_android.h" |
| 8 #include "components/dom_distiller/core/distilled_page_prefs.h" |
| 9 #include "components/dom_distiller/core/distilled_page_prefs_android.h" |
| 10 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 11 #include "jni/DomDistillerService_jni.h" |
| 12 |
| 13 namespace dom_distiller { |
| 14 namespace android { |
| 15 |
| 16 DomDistillerServiceAndroid::DomDistillerServiceAndroid( |
| 17 DomDistillerService* service) |
| 18 : service_(service) { |
| 19 JNIEnv* env = base::android::AttachCurrentThread(); |
| 20 base::android::ScopedJavaLocalRef<jobject> local_java_ref = |
| 21 Java_DomDistillerService_create(env, reinterpret_cast<intptr_t>(this)); |
| 22 java_ref_.Reset(env, local_java_ref.obj()); |
| 23 } |
| 24 |
| 25 DomDistillerServiceAndroid::~DomDistillerServiceAndroid() { |
| 26 } |
| 27 |
| 28 jlong DomDistillerServiceAndroid::GetDistilledPagePrefsPtr(JNIEnv* env, |
| 29 jobject obj) { |
| 30 return reinterpret_cast<intptr_t>(service_->GetDistilledPagePrefs()); |
| 31 } |
| 32 |
| 33 bool DomDistillerServiceAndroid::Register(JNIEnv* env) { |
| 34 return RegisterNativesImpl(env); |
| 35 } |
| 36 |
| 37 } // namespace android |
| 38 } // namespace dom_distiller |
OLD | NEW |