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

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: modified DEPS for test dependencies 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..a4edfbd690516145a0f87b2022e57c9c06627dc3
--- /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);
+}
+
+jint DistilledPagePrefsAndroid::GetTheme(JNIEnv* env, jobject obj) {
+ return (int)distilled_page_prefs_->GetTheme();
+}
+
+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