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

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

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Spacing and indentation Created 6 years, 6 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/reader_mode_preferences_android.cc
diff --git a/components/dom_distiller/core/reader_mode_preferences_android.cc b/components/dom_distiller/core/reader_mode_preferences_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1154c3acf0353a664b654a01d1239852bae7fc6b
--- /dev/null
+++ b/components/dom_distiller/core/reader_mode_preferences_android.cc
@@ -0,0 +1,32 @@
+// 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/reader_mode_preferences_android.h"
+#include "components/dom_distiller/core/reader_mode_preferences.h"
+
+#include "jni/ReaderModePreferencesAndroid_jni.h"
+
+namespace dom_distiller {
+namespace reader_mode_preferences {
nyquist 2014/06/30 20:33:24 remove namespace
sunangel 2014/07/07 21:21:30 Done.
+namespace android {
+
+void SetHighContrastMode(JNIEnv* env,
nyquist 2014/06/30 20:33:24 This should probably be SetTheme
sunangel 2014/07/07 21:21:30 Done.
+ jobject obj,
+ jlong ptr,
+ jboolean enabled) {
nyquist 2014/06/30 20:33:24 Shouldn't this take in a theme? You might have to
sunangel 2014/07/07 21:21:30 Done.
+ ReaderModePrefs* myReaderModePrefs = reinterpret_cast<ReaderModePrefs*>(ptr);
+ if (enabled) {
+ myReaderModePrefs->SetThemePref(ReaderModePrefs::Theme::kHighContrast);
+ } else {
+ myReaderModePrefs->SetThemePref(ReaderModePrefs::Theme::kNormal);
+ }
+}
+
+bool RegisterReaderModePrefsAndroid(JNIEnv* env) {
nyquist 2014/06/30 20:33:24 DistilledPagePrefs
sunangel 2014/07/07 21:21:30 just turned into register because made it in a cla
+ return RegisterNativesImpl(env);
+}
+
+} // namespace android
+} // namespace reader_mode_preferences
+} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698