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

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

Issue 341563002: Theme Preferences for Distilled Pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor 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.cc
diff --git a/components/dom_distiller/core/reader_mode_preferences.cc b/components/dom_distiller/core/reader_mode_preferences.cc
new file mode 100644
index 0000000000000000000000000000000000000000..267e6243d7f79e09e3d99343f389a0fcd88f53a2
--- /dev/null
+++ b/components/dom_distiller/core/reader_mode_preferences.cc
@@ -0,0 +1,39 @@
+// 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.h"
+
+#include "base/prefs/pref_service.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+
+namespace {
+
+// True if user prefers high-contrast (dark) appearance when in reader mode.
+const char kHighContrastPref[] = "reader_mode.high_contrast";
+
+}
+
+namespace dom_distiller {
+
+ReaderModePrefs::ReaderModePrefs(PrefService* pref_service)
+ : pref_service_(pref_service) {
+}
+
+void ReaderModePrefs::RegisterProfilePrefs(
battre 2014/06/24 07:46:40 // static void ReaderModePrefs::RegisterProfilePre
smaslo 2014/06/24 18:11:18 Done.
+ user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterBooleanPref(kHighContrastPref,
+ false,
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+}
+
+void ReaderModePrefs::SetHighContrastPref(bool new_value) {
+ pref_service_->SetBoolean(kHighContrastPref, new_value);
+}
+
+bool ReaderModePrefs::GetHighContrastPref() const {
+ return pref_service_->GetBoolean(kHighContrastPref);
+}
+
+} // namespace dom_distiller
+

Powered by Google App Engine
This is Rietveld 408576698