Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: components/dom_distiller/core/distilled_page_prefs_android.cc

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting changes, added test Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..ec7e20a3892edfb007f11825cd9c82bfb627d4be
--- /dev/null
+++ b/components/dom_distiller/core/distilled_page_prefs_android.cc
@@ -0,0 +1,45 @@
+// 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"
+#include "jni/DistilledPagePrefs_jni.h"
+
+namespace dom_distiller {
+namespace android {
+
+DistilledPagePrefsAndroid::DistilledPagePrefsAndroid(
+ JNIEnv* env,
+ jobject obj,
+ DistilledPagePrefs* distillerPagePrefsPtr)
+ : distilled_page_prefs_(distillerPagePrefsPtr) {
+}
+
+DistilledPagePrefsAndroid::~DistilledPagePrefsAndroid() {
+}
+
+void DistilledPagePrefsAndroid::SetTheme(JNIEnv* env, jobject obj, jint theme) {
+ distilled_page_prefs_->SetTheme((DistilledPagePrefs::Theme)theme);
nyquist 2014/07/09 23:49:04 I think a whitespace is missing after the cast. Co
sunangel 2014/07/10 14:31:53 not missing a space. added a space, ran git cl for
+}
+
+jint DistilledPagePrefsAndroid::GetThemeValue(JNIEnv* env, jobject obj) {
+ return (int)distilled_page_prefs_->GetTheme();
nyquist 2014/07/09 23:49:04 same as above about whitespace
sunangel 2014/07/10 14:31:53 same as above. On 2014/07/09 23:49:04, nyquist wro
+}
+
+jlong Init(JNIEnv* env, jobject obj, jlong distilledPagePrefsPtr) {
+ DistilledPagePrefs* distilledPagePrefs =
+ reinterpret_cast<DistilledPagePrefs*>(distilledPagePrefsPtr);
+ DistilledPagePrefsAndroid* distilled_page_prefs_android =
+ new DistilledPagePrefsAndroid(env, obj, distilledPagePrefs);
+ return reinterpret_cast<intptr_t>(distilled_page_prefs_android);
+}
+
+bool DistilledPagePrefsAndroid::Register(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace android
+} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698