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/distilled_page_prefs_android.h" |
| 6 |
| 7 #include "components/dom_distiller/core/distilled_page_prefs.h" |
| 8 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 9 #include "jni/DistilledPagePrefs_jni.h" |
| 10 |
| 11 namespace dom_distiller { |
| 12 namespace android { |
| 13 |
| 14 DistilledPagePrefsAndroid::DistilledPagePrefsAndroid( |
| 15 JNIEnv* env, |
| 16 jobject obj, |
| 17 DistilledPagePrefs* distillerPagePrefsPtr) |
| 18 : distilled_page_prefs_(distillerPagePrefsPtr) { |
| 19 } |
| 20 |
| 21 DistilledPagePrefsAndroid::~DistilledPagePrefsAndroid() { |
| 22 } |
| 23 |
| 24 void DistilledPagePrefsAndroid::SetTheme(JNIEnv* env, jobject obj, jint theme) { |
| 25 distilled_page_prefs_->SetTheme((DistilledPagePrefs::Theme)theme); |
| 26 } |
| 27 |
| 28 jint DistilledPagePrefsAndroid::GetTheme(JNIEnv* env, jobject obj) { |
| 29 return (int)distilled_page_prefs_->GetTheme(); |
| 30 } |
| 31 |
| 32 jlong Init(JNIEnv* env, jobject obj, jlong distilledPagePrefsPtr) { |
| 33 DistilledPagePrefs* distilledPagePrefs = |
| 34 reinterpret_cast<DistilledPagePrefs*>(distilledPagePrefsPtr); |
| 35 DistilledPagePrefsAndroid* distilled_page_prefs_android = |
| 36 new DistilledPagePrefsAndroid(env, obj, distilledPagePrefs); |
| 37 return reinterpret_cast<intptr_t>(distilled_page_prefs_android); |
| 38 } |
| 39 |
| 40 bool DistilledPagePrefsAndroid::Register(JNIEnv* env) { |
| 41 return RegisterNativesImpl(env); |
| 42 } |
| 43 |
| 44 } // namespace android |
| 45 } // namespace dom_distiller |
OLD | NEW |