| 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..c42f535c353837bb528738c42f721eb7431ae4b3
|
| --- /dev/null
|
| +++ b/components/dom_distiller/core/reader_mode_preferences.cc
|
| @@ -0,0 +1,41 @@
|
| +// Copyright 2014 The Chromium Authros. 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 <string>
|
| +#include <vector>
|
| +
|
| +#include "base/prefs/pref_service.h"
|
| +#include "base/strings/string_util.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "components/dom_distiller/core/dom_distiller_pref_names.h"
|
| +#include "components/dom_distiller/core/url_constants.h"
|
| +#include "components/pref_registry/pref_registry_syncable.h"
|
| +#include "grit/component_resources.h"
|
| +#include "ui/base/resource/resource_bundle.h"
|
| +
|
| +namespace dom_distiller {
|
| +
|
| +ReaderModePrefs::ReaderModePrefs(Profile* profile)
|
| + : profile_(profile) {
|
| +}
|
| +
|
| +void ReaderModePrefs::RegisterProfilePrefs(
|
| + user_prefs::PrefRegistrySyncable* registry) {
|
| + registry->RegisterBooleanPref(prefs::kHighContrastPref,
|
| + false,
|
| + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
| +}
|
| +
|
| +void ReaderModePrefs::OnChangeHighContrast(bool new_value) {
|
| + profile_->GetPrefs()->SetBoolean(prefs::kHighContrastPref, new_value);
|
| +}
|
| +
|
| +bool ReaderModePrefs::GetHighContrastPref() {
|
| + return profile_->GetPrefs()->GetBoolean(prefs::kHighContrastPref);
|
| +}
|
| +
|
| +} // namespace dom_distiller
|
| +
|
|
|