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

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 change to constant name 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 Authros. 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 <string>
8 #include <vector>
9
10 #include "base/prefs/pref_service.h"
11 #include "base/strings/string_util.h"
12 #include "chrome/browser/profiles/profile.h"
13 #include "components/dom_distiller/core/dom_distiller_pref_names.h"
14 #include "components/dom_distiller/core/url_constants.h"
nyquist 2014/06/23 16:03:06 Are all these includes in use?
smaslo 2014/06/23 22:14:33 Done.
15 #include "components/pref_registry/pref_registry_syncable.h"
16 #include "grit/component_resources.h"
17 #include "ui/base/resource/resource_bundle.h"
18
19 namespace dom_distiller {
20
21 ReaderModePrefs::ReaderModePrefs(Profile* profile)
22 : profile_(profile) {
23 }
24
25 void ReaderModePrefs::RegisterProfilePrefs(
26 user_prefs::PrefRegistrySyncable* registry) {
27 registry->RegisterBooleanPref(prefs::kHighContrastPref,
28 false,
29 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
30 }
31
32 void ReaderModePrefs::OnChangeHighContrast(bool new_value) {
battre 2014/06/23 08:37:23 WDYT of renaming this to SetHighContrastPref(bool
nyquist 2014/06/23 16:03:06 Like battre suggests, having consistent naming acr
smaslo 2014/06/23 22:14:33 Done.
smaslo 2014/06/23 22:14:33 Done.
33 profile_->GetPrefs()->SetBoolean(prefs::kHighContrastPref, new_value);
nyquist 2014/06/23 16:03:06 This code and below will become simpler when you j
smaslo 2014/06/23 22:14:33 Done.
34 }
35
36 bool ReaderModePrefs::GetHighContrastPref() {
37 return profile_->GetPrefs()->GetBoolean(prefs::kHighContrastPref);
38 }
39
40 } // namespace dom_distiller
41
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698