Chromium Code Reviews| 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_android.h" | |
| 6 | |
| 7 #include "base/android/jni_android.h" | |
| 8 #include "components/dom_distiller/core/distilled_page_prefs.h" | |
| 9 #include "components/dom_distiller/core/distilled_page_prefs_android.h" | |
| 10 #include "components/dom_distiller/core/dom_distiller_service.h" | |
| 11 #include "jni/DomDistillerService_jni.h" | |
| 12 | |
| 13 namespace dom_distiller { | |
| 14 namespace android { | |
| 15 | |
| 16 DomDistillerServiceAndroid::DomDistillerServiceAndroid( | |
| 17 DomDistillerService* service) | |
| 18 : service_(service) { | |
| 19 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 20 base::android::ScopedJavaLocalRef<jobject> local_java_ref = | |
| 21 Java_DomDistillerService_create(env, reinterpret_cast<intptr_t>(this)); | |
| 22 java_ref_.Reset(env, local_java_ref.obj()); | |
| 23 } | |
| 24 | |
| 25 DomDistillerServiceAndroid::~DomDistillerServiceAndroid() { | |
| 26 } | |
| 27 | |
| 28 /** | |
| 29 * Returns native pointer to native DistilledPagePrefs registered with | |
|
nyquist
2014/07/14 18:06:25
Move this comment to the header file.
sunangel
2014/07/15 15:39:51
Done.
| |
| 30 * DomDistillerService. | |
| 31 */ | |
| 32 jlong DomDistillerServiceAndroid::GetDistilledPagePrefsPtr(JNIEnv* env, | |
| 33 jobject obj) { | |
| 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 | |
| OLD | NEW |