| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_ANDROID_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_ANDROID_H_ |
| 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_ANDROID_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "components/dom_distiller/core/dom_distiller_service.h" | 11 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 12 | 12 |
| 13 namespace dom_distiller { | 13 namespace dom_distiller { |
| 14 namespace android { | 14 namespace android { |
| 15 | 15 |
| 16 class DomDistillerServiceFactoryAndroid; | 16 class DomDistillerServiceFactoryAndroid; |
| 17 | 17 |
| 18 // Native implementation of DomDistillerService, | 18 // Native implementation of DomDistillerService, |
| 19 // provides access to Java DistilledPagePrefs. | 19 // provides access to Java DistilledPagePrefs. |
| 20 class DomDistillerServiceAndroid { | 20 class DomDistillerServiceAndroid { |
| 21 public: | 21 public: |
| 22 DomDistillerServiceAndroid(DomDistillerService* service); | 22 DomDistillerServiceAndroid(DomDistillerService* service); |
| 23 virtual ~DomDistillerServiceAndroid(); | 23 virtual ~DomDistillerServiceAndroid(); |
| 24 static bool Register(JNIEnv* env); | 24 static bool Register(JNIEnv* env); |
| 25 // Returns native pointer to native DistilledPagePrefs registered with | 25 // Returns native pointer to native DistilledPagePrefs registered with |
| 26 // DomDistillerService. | 26 // DomDistillerService. |
| 27 jlong GetDistilledPagePrefsPtr(JNIEnv* env, jobject obj); | 27 jlong GetDistilledPagePrefsPtr(JNIEnv* env, jobject obj); |
| 28 bool HasEntry(JNIEnv* env, jobject obj, jstring entry_id); |
| 29 base::android::ScopedJavaLocalRef<jstring> GetUrlForEntry(JNIEnv* env, |
| 30 jobject obj, |
| 31 jstring entry_id); |
| 28 | 32 |
| 29 private: | 33 private: |
| 30 // Friend class so that DomDistillerServiceFactoryAndroid has access to | 34 // Friend class so that DomDistillerServiceFactoryAndroid has access to |
| 31 // private member object java_ref_. | 35 // private member object java_ref_. |
| 32 friend class DomDistillerServiceFactoryAndroid; | 36 friend class DomDistillerServiceFactoryAndroid; |
| 33 // Points to a Java instance of DomDistillerService. | 37 // Points to a Java instance of DomDistillerService. |
| 34 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 38 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 35 DomDistillerService* service_; | 39 DomDistillerService* service_; |
| 36 }; | 40 }; |
| 37 | 41 |
| 38 } // namespace android | 42 } // namespace android |
| 39 } // namespace dom_distiller | 43 } // namespace dom_distiller |
| 40 | 44 |
| 41 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_ANDROID_H | 45 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_ANDROID_H |
| OLD | NEW |