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.h" |
| 6 #include "components/dom_distiller/core/dom_distiller_service_android.h" |
| 7 #include "components/dom_distiller/core/reader_mode_preferences.h" |
| 8 |
| 9 #include "jni/DomDistillerService_jni.h" |
| 10 |
| 11 DomDistillerServiceAndroid::DomDistillerServiceAndroid( |
| 12 JNIEnv* env, |
| 13 jobject obj, |
| 14 dom_distiller::DomDistillerService* ptr) { |
| 15 service_ = ptr; |
| 16 } |
| 17 |
| 18 jlong Init(JNIEnv* env, jobject obj, jlong servicePtr) { |
| 19 dom_distiller::DomDistillerService* s = |
| 20 reinterpret_cast<dom_distiller::DomDistillerService*>(servicePtr); |
| 21 DomDistillerServiceAndroid* dom_distiller_service_android = |
| 22 new DomDistillerServiceAndroid(env, obj, s); |
| 23 return reinterpret_cast<intptr_t>(dom_distiller_service_android); |
| 24 } |
| 25 |
| 26 /** |
| 27 * Returns native pointer to native reader mode preferences registered with |
| 28 * dom_distiller_service. |
| 29 */ |
| 30 jlong DomDistillerServiceAndroid::GetReaderModePrefsPointer(JNIEnv* env, |
| 31 jobject obj) { |
| 32 return reinterpret_cast<intptr_t>(service_->GetReaderModePrefs()); |
| 33 } |
| 34 |
| 35 bool DomDistillerServiceAndroid::Register(JNIEnv* env) { |
| 36 return RegisterNativesImpl(env); |
| 37 } |
OLD | NEW |