Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: components/dom_distiller/core/dom_distiller_service_android.cc

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Spacing and indentation Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698