Chromium Code Reviews| OLD | NEW |
|---|---|
| (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/url_constants.h" | |
| 14 #include "components/pref_registry/pref_registry_syncable.h" | |
| 15 #include "grit/component_resources.h" | |
| 16 #include "ui/base/resource/resource_bundle.h" | |
| 17 | |
| 18 namespace prefs { | |
| 19 const char kHigh_Contrast_Pref[] = "reader_mode.high_contrast"; | |
|
robliao
2014/06/17 23:08:15
Remove one level of indentation.
smaslo
2014/06/18 16:57:15
Done.
| |
| 20 } | |
| 21 | |
| 22 namespace dom_distiller { | |
| 23 | |
| 24 ReaderModePrefs::ReaderModePrefs(Profile* profile) | |
| 25 :profile_(profile) { | |
|
robliao
2014/06/17 23:08:15
Add Space between : and profile_(...
smaslo
2014/06/18 16:57:15
Done.
| |
| 26 } | |
| 27 | |
| 28 void ReaderModePrefs::RegisterProfilePrefs( | |
| 29 user_prefs::PrefRegistrySyncable* registry) { | |
| 30 registry->RegisterBooleanPref(prefs::kHigh_Contrast_Pref, | |
| 31 false, | |
| 32 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 33 } | |
| 34 | |
| 35 void ReaderModePrefs::OnChangeHighContrast(bool new_value) { | |
| 36 profile_->GetPrefs()->SetBoolean(prefs::kHigh_Contrast_Pref, new_value); | |
| 37 } | |
|
robliao
2014/06/17 23:08:15
Add linebreak here.
smaslo
2014/06/18 16:57:15
Done.
| |
| 38 bool ReaderModePrefs::GetHighContrastPref() { | |
| 39 return profile_->GetPrefs()->GetBoolean(prefs::kHigh_Contrast_Pref); | |
| 40 } | |
| 41 | |
| 42 } // namespace dom_distiller | |
| 43 | |
| OLD | NEW |