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( | |
nyquist
2014/06/30 20:33:23
This constructor can call a private static create
sunangel
2014/07/07 21:21:29
Done.
| |
12 JNIEnv* env, | |
13 jobject obj, | |
14 dom_distiller::DomDistillerService* ptr) { | |
nyquist
2014/06/30 20:33:23
Nit: service
sunangel
2014/07/07 21:21:29
Done.
| |
15 service_ = ptr; | |
nyquist
2014/06/30 20:33:23
How about you call a static create method here on
sunangel
2014/07/07 21:21:29
Done.
| |
16 } | |
17 | |
18 jlong Init(JNIEnv* env, jobject obj, jlong servicePtr) { | |
nyquist
2014/06/30 20:33:23
I think we can turn this around and you could inst
sunangel
2014/07/07 21:21:29
Done.
| |
19 dom_distiller::DomDistillerService* s = | |
nyquist
2014/06/30 20:33:23
|service|
sunangel
2014/07/07 21:21:30
Done.
| |
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, | |
nyquist
2014/06/30 20:33:23
This can instead return the jobject DistilledPageP
sunangel
2014/07/07 21:21:29
not doing this as per conversation
On 2014/06/30 2
| |
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 |