| 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 #include "components/dom_distiller/core/dom_distiller_service_android.h" | 5 #include "components/dom_distiller/core/dom_distiller_service_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "components/dom_distiller/core/distilled_page_prefs.h" | 10 #include "components/dom_distiller/core/distilled_page_prefs.h" |
| 11 #include "components/dom_distiller/core/distilled_page_prefs_android.h" | 11 #include "components/dom_distiller/core/distilled_page_prefs_android.h" |
| 12 #include "components/dom_distiller/core/dom_distiller_service.h" | 12 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 13 #include "jni/DomDistillerService_jni.h" | 13 #include "jni/DomDistillerService_jni.h" |
| 14 | 14 |
| 15 using base::android::ConvertUTF8ToJavaString; | 15 using base::android::ConvertUTF8ToJavaString; |
| 16 using base::android::JavaParamRef; |
| 16 using base::android::ScopedJavaLocalRef; | 17 using base::android::ScopedJavaLocalRef; |
| 17 | 18 |
| 18 namespace dom_distiller { | 19 namespace dom_distiller { |
| 19 namespace android { | 20 namespace android { |
| 20 | 21 |
| 21 DomDistillerServiceAndroid::DomDistillerServiceAndroid( | 22 DomDistillerServiceAndroid::DomDistillerServiceAndroid( |
| 22 DomDistillerService* service) | 23 DomDistillerService* service) |
| 23 : service_(service) { | 24 : service_(service) { |
| 24 JNIEnv* env = base::android::AttachCurrentThread(); | 25 JNIEnv* env = base::android::AttachCurrentThread(); |
| 25 base::android::ScopedJavaLocalRef<jobject> local_java_ref = | 26 base::android::ScopedJavaLocalRef<jobject> local_java_ref = |
| (...skipping 27 matching lines...) Expand all Loading... |
| 53 const JavaParamRef<jobject>& obj) { | 54 const JavaParamRef<jobject>& obj) { |
| 54 return reinterpret_cast<intptr_t>(service_->GetDistilledPagePrefs()); | 55 return reinterpret_cast<intptr_t>(service_->GetDistilledPagePrefs()); |
| 55 } | 56 } |
| 56 | 57 |
| 57 bool DomDistillerServiceAndroid::Register(JNIEnv* env) { | 58 bool DomDistillerServiceAndroid::Register(JNIEnv* env) { |
| 58 return RegisterNativesImpl(env); | 59 return RegisterNativesImpl(env); |
| 59 } | 60 } |
| 60 | 61 |
| 61 } // namespace android | 62 } // namespace android |
| 62 } // namespace dom_distiller | 63 } // namespace dom_distiller |
| OLD | NEW |