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

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: namespaces to classes, native init, enum 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_android.h"
6
7 #include "base/android/jni_android.h"
8
nyquist 2014/07/08 01:02:34 remove empty line
sunangel 2014/07/08 20:41:00 Done.
9 #include "components/dom_distiller/core/distilled_page_prefs.h"
10 #include "components/dom_distiller/core/distilled_page_prefs_android.h"
11 #include "components/dom_distiller/core/dom_distiller_service.h"
12
nyquist 2014/07/08 01:02:34 remove empty line
sunangel 2014/07/08 20:41:00 Done.
13 #include "jni/DomDistillerService_jni.h"
14
15 namespace dom_distiller{
16 namespace android {
17
18 DomDistillerServiceAndroid::DomDistillerServiceAndroid(
19 dom_distiller::DomDistillerService* service):service_(service) {
nyquist 2014/07/08 01:02:34 See style guide for how this should be written: ht
sunangel 2014/07/08 20:41:00 Done.
20 JNIEnv* env = base::android::AttachCurrentThread();
21 base::android::ScopedJavaLocalRef<jobject> local_java_ref =
22 Java_DomDistillerService_create(env, reinterpret_cast<intptr_t>(this));
23 java_ref_.Reset(env, local_java_ref.obj());
24 }
25
26 DomDistillerServiceAndroid::~DomDistillerServiceAndroid() {}
27
28 /**
29 * Returns native pointer to native distilled page preferences registered with
30 * dom_distiller_service.
31 */
32 jlong DomDistillerServiceAndroid::GetDistilledPagePrefsPointer(JNIEnv* env,
33 jobject obj) {
nyquist 2014/07/08 01:02:34 indent seems to be off?
sunangel 2014/07/08 20:41:00 Done.
34 return reinterpret_cast<intptr_t>(service_->GetDistilledPagePrefs());
35 }
36
37 bool DomDistillerServiceAndroid::Register(JNIEnv* env) {
38 return RegisterNativesImpl(env);
39 }
40
41 } // namespace android
42 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698