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

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: Changes from comments on patch 9 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.
nyquist 2014/06/24 23:08:49 s/True if user prefers/Whether user prefers/
smaslo 2014/06/26 20:05:38 Changed entirely
13 const char kHighContrastPref[] = "reader_mode.high_contrast";
nyquist 2014/06/24 23:08:49 I wonder if we should prefix this preference with
smaslo 2014/06/26 20:05:38 Done.
14
15 }
16
17 namespace dom_distiller {
18
19 ReaderModePrefs::ReaderModePrefs(PrefService* pref_service)
20 : pref_service_(pref_service) {
21 }
22
23 // static
24 void ReaderModePrefs::RegisterProfilePrefs(
25 user_prefs::PrefRegistrySyncable* registry) {
26 registry->RegisterBooleanPref(kHighContrastPref,
27 false,
28 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
29 }
30
31 void ReaderModePrefs::SetHighContrastPref(bool new_value) {
32 pref_service_->SetBoolean(kHighContrastPref, new_value);
33 }
34
35 bool ReaderModePrefs::GetHighContrastPref() const {
36 return pref_service_->GetBoolean(kHighContrastPref);
37 }
38
39 } // namespace dom_distiller
40
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698