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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/dom_distiller/core/reader_mode_preferences.h"
6
7 #include "base/prefs/pref_service.h"
8 #include "components/pref_registry/pref_registry_syncable.h"
9
10 namespace {
11
12 // True if user prefers high-contrast (dark) appearance when in reader mode.
13 const char kHighContrastPref[] = "reader_mode.high_contrast";
14
15 }
16
17 namespace dom_distiller {
18
19 ReaderModePrefs::ReaderModePrefs(PrefService* pref_service)
20 : pref_service_(pref_service) {
21 }
22
23 void ReaderModePrefs::RegisterProfilePrefs(
battre 2014/06/24 07:46:40 // static void ReaderModePrefs::RegisterProfilePre
smaslo 2014/06/24 18:11:18 Done.
24 user_prefs::PrefRegistrySyncable* registry) {
25 registry->RegisterBooleanPref(kHighContrastPref,
26 false,
27 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
28 }
29
30 void ReaderModePrefs::SetHighContrastPref(bool new_value) {
31 pref_service_->SetBoolean(kHighContrastPref, new_value);
32 }
33
34 bool ReaderModePrefs::GetHighContrastPref() const {
35 return pref_service_->GetBoolean(kHighContrastPref);
36 }
37
38 } // namespace dom_distiller
39
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698