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" |
nyquist
2014/06/23 16:03:06
Are all these includes in use?
smaslo
2014/06/23 22:14:33
Done.
|
+#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) { |
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.
|
+ 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.
|
+} |
+ |
+bool ReaderModePrefs::GetHighContrastPref() { |
+ return profile_->GetPrefs()->GetBoolean(prefs::kHighContrastPref); |
+} |
+ |
+} // namespace dom_distiller |
+ |