Chromium Code Reviews| 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..c1b1bda1f91eb6953e93481fff7c37745804832b |
| --- /dev/null |
| +++ b/components/dom_distiller/core/dom_distiller_service_android.cc |
| @@ -0,0 +1,33 @@ |
| +// 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); |
| +} |
| + |
| +jlong DomDistillerServiceAndroid::GetReaderModePrefsPointer(JNIEnv* env, |
| + jobject obj) { |
| + 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.
|
| +} |
| + |
| +bool DomDistillerServiceAndroid::Register(JNIEnv* env) { |
| + return RegisterNativesImpl(env); |
| +} |