Index: components/dom_distiller/core/distilled_page_prefs_android.cc |
diff --git a/components/dom_distiller/core/distilled_page_prefs_android.cc b/components/dom_distiller/core/distilled_page_prefs_android.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..eae76d64d7b9ad54f5de7d2dadfbed6307dc6031 |
--- /dev/null |
+++ b/components/dom_distiller/core/distilled_page_prefs_android.cc |
@@ -0,0 +1,34 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/dom_distiller/core/distilled_page_prefs_android.h" |
+ |
+#include "components/dom_distiller/core/distilled_page_prefs.h" |
+#include "components/dom_distiller/core/dom_distiller_service.h" |
+ |
nyquist
2014/07/08 01:02:34
remove empty line
sunangel
2014/07/08 20:40:59
Done.
|
+#include "jni/DistilledPagePrefs_jni.h" |
+ |
nyquist
2014/07/08 01:02:34
add namespace dom_distiller and android.
sunangel
2014/07/08 20:40:59
Done.
|
+DistilledPagePrefsAndroid::DistilledPagePrefsAndroid(JNIEnv* env, jobject obj, |
+ dom_distiller::DistilledPagePrefs* ptr):distilled_page_prefs_(ptr) {} |
nyquist
2014/07/08 01:02:34
call the parameter for distilled_page_prefs.
See
sunangel
2014/07/08 20:40:59
Done.
|
+ |
+DistilledPagePrefsAndroid::~DistilledPagePrefsAndroid() {} |
+ |
+void DistilledPagePrefsAndroid::SetTheme(JNIEnv* env, |
+ jobject obj, |
+ jint color_mode) { |
nyquist
2014/07/08 01:02:34
s/color_mode/theme/
sunangel
2014/07/08 20:40:58
Done.
|
+ distilled_page_prefs_->SetTheme( |
+ (dom_distiller::DistilledPagePrefs::Theme)color_mode); |
nyquist
2014/07/08 01:02:34
whitespace after cast.
sunangel
2014/07/08 20:40:59
Done.
|
+ } |
+ |
+jlong Init(JNIEnv* env, jobject obj, jlong servicePtr) { |
nyquist
2014/07/08 01:02:34
This is not the service pointer anymore. Rename to
sunangel
2014/07/08 20:40:59
Done.
|
+ dom_distiller::DistilledPagePrefs* ptr = |
nyquist
2014/07/08 01:02:34
s/ptr/distilledPagePrefs/
sunangel
2014/07/08 20:40:59
Done.
|
+ reinterpret_cast<dom_distiller::DistilledPagePrefs*>(servicePtr); |
+ DistilledPagePrefsAndroid* dom_distiller_service_android = |
nyquist
2014/07/08 01:02:33
distilled_page_prefs_android
sunangel
2014/07/08 20:40:59
Done.
|
+ new DistilledPagePrefsAndroid(env, obj, ptr); |
+ return reinterpret_cast<intptr_t>(dom_distiller_service_android); |
+} |
+ |
+bool DistilledPagePrefsAndroid::Register(JNIEnv* env) { |
+ return RegisterNativesImpl(env); |
+} |