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 |