| Index: components/dom_distiller/core/dom_distiller_service_android.cc
|
| diff --git a/components/dom_distiller/core/dom_distiller_service_android.cc b/components/dom_distiller/core/dom_distiller_service_android.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..563a31c51061bd70dbfb875e5ac73cc2c282faf5
|
| --- /dev/null
|
| +++ b/components/dom_distiller/core/dom_distiller_service_android.cc
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "components/dom_distiller/core/dom_distiller_service.h"
|
| +#include "components/dom_distiller/core/dom_distiller_service_android.h"
|
| +#include "components/dom_distiller/core/reader_mode_preferences.h"
|
| +
|
| +#include "jni/DomDistillerService_jni.h"
|
| +
|
| +DomDistillerServiceAndroid::DomDistillerServiceAndroid(
|
| + JNIEnv* env,
|
| + jobject obj,
|
| + dom_distiller::DomDistillerService* ptr) {
|
| + service_ = ptr;
|
| +}
|
| +
|
| +jlong Init(JNIEnv* env, jobject obj, jlong servicePtr) {
|
| + dom_distiller::DomDistillerService* s =
|
| + reinterpret_cast<dom_distiller::DomDistillerService*>(servicePtr);
|
| + DomDistillerServiceAndroid* dom_distiller_service_android =
|
| + new DomDistillerServiceAndroid(env, obj, s);
|
| + return reinterpret_cast<intptr_t>(dom_distiller_service_android);
|
| +}
|
| +
|
| +/**
|
| + * Returns native pointer to native reader mode preferences registered with
|
| + * dom_distiller_service.
|
| + */
|
| +jlong DomDistillerServiceAndroid::GetReaderModePrefsPointer(JNIEnv* env,
|
| + jobject obj) {
|
| + return reinterpret_cast<intptr_t>(service_->GetReaderModePrefs());
|
| +}
|
| +
|
| +bool DomDistillerServiceAndroid::Register(JNIEnv* env) {
|
| + return RegisterNativesImpl(env);
|
| +}
|
|
|