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 |
| index 5f6559404525456a64a3b73bc65ac0cce82e07d0..30d90001fbff16708eec63acad300120ca6c5a57 100644 |
| --- a/components/dom_distiller/core/dom_distiller_service_android.cc |
| +++ b/components/dom_distiller/core/dom_distiller_service_android.cc |
| @@ -5,11 +5,16 @@ |
| #include "components/dom_distiller/core/dom_distiller_service_android.h" |
| #include "base/android/jni_android.h" |
| +#include "base/android/jni_string.h" |
| +#include "base/android/scoped_java_ref.h" |
| #include "components/dom_distiller/core/distilled_page_prefs.h" |
| #include "components/dom_distiller/core/distilled_page_prefs_android.h" |
| #include "components/dom_distiller/core/dom_distiller_service.h" |
| #include "jni/DomDistillerService_jni.h" |
| +using base::android::ConvertUTF8ToJavaString; |
| +using base::android::ScopedJavaLocalRef; |
| + |
| namespace dom_distiller { |
| namespace android { |
| @@ -25,6 +30,23 @@ DomDistillerServiceAndroid::DomDistillerServiceAndroid( |
| DomDistillerServiceAndroid::~DomDistillerServiceAndroid() { |
| } |
| +bool DomDistillerServiceAndroid::HasEntry(JNIEnv* env, |
| + jobject obj, |
| + jstring j_entry_id) { |
| + std::string entry_id = |
|
robliao
2014/08/13 23:43:15
const std::string
sunangel
2014/08/13 23:47:15
Done.
|
| + base::android::ConvertJavaStringToUTF8(env, j_entry_id); |
| + return service_->HasEntry(entry_id); |
| +} |
| + |
| +ScopedJavaLocalRef<jstring> DomDistillerServiceAndroid::GetUrlForEntry( |
| + JNIEnv* env, |
| + jobject obj, |
| + jstring j_entry_id) { |
| + const std::string entry_id = |
| + base::android::ConvertJavaStringToUTF8(env, j_entry_id); |
| + return ConvertUTF8ToJavaString(env, service_->GetUrlForEntry(entry_id)); |
| +} |
| + |
| jlong DomDistillerServiceAndroid::GetDistilledPagePrefsPtr(JNIEnv* env, |
| jobject obj) { |
| return reinterpret_cast<intptr_t>(service_->GetDistilledPagePrefs()); |