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 jlong DomDistillerServiceAndroid::GetReaderModePrefsPointer(JNIEnv* env, | |
27 jobject obj) { | |
28 return reinterpret_cast<intptr_t>(service_->GetReaderModePrefs()); | |
robliao
2014/06/26 18:42:15
Worth commenting why this works and where this liv
sunangel
2014/06/27 16:27:25
Done.
| |
29 } | |
30 | |
31 bool DomDistillerServiceAndroid::Register(JNIEnv* env) { | |
32 return RegisterNativesImpl(env); | |
33 } | |
OLD | NEW |