Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. 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 #ifndef COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_ | |
| 6 #define COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/observer_list.h" | |
| 10 | |
| 11 class PrefService; | |
| 12 | |
| 13 namespace user_prefs { | |
| 14 class PrefRegistrySyncable; | |
| 15 } | |
| 16 | |
| 17 namespace dom_distiller { | |
| 18 | |
| 19 // Interface for preferences used in reader mode view. | |
| 20 class ReaderModePrefs { | |
| 21 public: | |
|
nyquist
2014/06/27 20:48:26
But: unnecessary newline I think?
smaslo
2014/06/30 17:57:15
Done.
| |
| 22 | |
| 23 // Possible themes for reader mode. | |
| 24 enum Theme { | |
| 25 kLight, | |
|
nyquist
2014/06/27 20:48:26
Awesome!
smaslo
2014/06/30 17:57:14
Done.
| |
| 26 kDark, | |
| 27 kSepia | |
| 28 }; | |
| 29 | |
| 30 class Observer { | |
| 31 public: | |
| 32 virtual void OnChangeTheme(Theme theme) = 0; | |
| 33 }; | |
| 34 | |
| 35 void AddObserver(Observer* obs); | |
| 36 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.
| |
| 37 | |
| 38 explicit ReaderModePrefs(PrefService* pref_service); | |
| 39 ~ReaderModePrefs(); | |
| 40 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | |
| 41 | |
| 42 void SetThemePref(Theme new_theme); | |
|
nyquist
2014/06/27 20:48:26
Just SetTheme
smaslo
2014/06/30 17:57:14
Done.
| |
| 43 | |
| 44 const Theme GetThemePref() const; | |
|
nyquist
2014/06/27 20:48:26
Just GetTheme
smaslo
2014/06/30 17:57:14
Done.
| |
| 45 | |
| 46 private: | |
| 47 PrefService* pref_service_; | |
| 48 ObserverList<Observer> observer_list_; | |
|
nyquist
2014/06/27 20:48:26
Could this just be 'observers_'?
smaslo
2014/06/30 17:57:14
Done.
| |
| 49 | |
| 50 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.
| |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(ReaderModePrefs); | |
| 53 }; | |
| 54 | |
| 55 } // namespace dom_distiller | |
| 56 | |
| 57 #endif // COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_ | |
| OLD | NEW |