Index: components/dom_distiller/core/reader_mode_preferences.h |
diff --git a/components/dom_distiller/core/reader_mode_preferences.h b/components/dom_distiller/core/reader_mode_preferences.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d8a160f3bc98d300befeb617d2063d6090ca8852 |
--- /dev/null |
+++ b/components/dom_distiller/core/reader_mode_preferences.h |
@@ -0,0 +1,57 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_ |
+#define COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_ |
+ |
+#include "base/macros.h" |
+#include "base/observer_list.h" |
+ |
+class PrefService; |
+ |
+namespace user_prefs { |
+class PrefRegistrySyncable; |
+} |
+ |
+namespace dom_distiller { |
+ |
+// Interface for preferences used in reader mode view. |
+class ReaderModePrefs { |
+ public: |
nyquist
2014/06/27 20:48:26
But: unnecessary newline I think?
smaslo
2014/06/30 17:57:15
Done.
|
+ |
+ // Possible themes for reader mode. |
+ enum Theme { |
+ kLight, |
nyquist
2014/06/27 20:48:26
Awesome!
smaslo
2014/06/30 17:57:14
Done.
|
+ kDark, |
+ kSepia |
+ }; |
+ |
+ class Observer { |
+ public: |
+ virtual void OnChangeTheme(Theme theme) = 0; |
+ }; |
+ |
+ void AddObserver(Observer* obs); |
+ void RemoveObserver(Observer* obs); |
nyquist
2014/06/27 20:48:26
Could you put these below the static register meth
smaslo
2014/06/30 17:57:14
Done.
|
+ |
+ explicit ReaderModePrefs(PrefService* pref_service); |
+ ~ReaderModePrefs(); |
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
+ |
+ void SetThemePref(Theme new_theme); |
nyquist
2014/06/27 20:48:26
Just SetTheme
smaslo
2014/06/30 17:57:14
Done.
|
+ |
+ const Theme GetThemePref() const; |
nyquist
2014/06/27 20:48:26
Just GetTheme
smaslo
2014/06/30 17:57:14
Done.
|
+ |
+ private: |
+ PrefService* pref_service_; |
+ ObserverList<Observer> observer_list_; |
nyquist
2014/06/27 20:48:26
Could this just be 'observers_'?
smaslo
2014/06/30 17:57:14
Done.
|
+ |
+ void NotifyOnChangeTheme(Theme theme); |
nyquist
2014/06/27 20:48:26
What does this method do? (Add comment)
Also, put
smaslo
2014/06/30 17:57:14
Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(ReaderModePrefs); |
+}; |
+ |
+} // namespace dom_distiller |
+ |
+#endif // COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_ |