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 | |
|
nyquist
2014/06/26 20:39:59
Nit: All comments like this should end with a peri
smaslo
2014/06/27 18:33:18
Done.
| |
| 20 class ReaderModePrefs { | |
| 21 public: | |
| 22 | |
| 23 // Possible themes for reader mode | |
|
nyquist
2014/06/26 20:39:59
Nit: end with period
smaslo
2014/06/27 18:33:18
Done.
| |
| 24 enum Theme { | |
| 25 kNormal, | |
|
nyquist
2014/06/26 20:39:58
See comment in CSS about naming. Make sure these t
smaslo
2014/06/27 18:33:18
Done.
| |
| 26 kHighContrast, | |
| 27 kSepia | |
| 28 }; | |
| 29 | |
| 30 explicit ReaderModePrefs(PrefService* pref_service); | |
| 31 ~ReaderModePrefs(); | |
| 32 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | |
| 33 | |
| 34 void SetThemePref(Theme new_theme); | |
| 35 | |
| 36 class Observer { | |
|
nyquist
2014/06/26 20:39:58
I think the observer class usually goes at the top
smaslo
2014/06/27 18:33:18
I put it below the enum because it needs to know a
| |
| 37 public: | |
| 38 virtual void OnChangeTheme(ReaderModePrefs* reader_mode_prefs) = 0; | |
|
nyquist
2014/06/26 20:39:58
Do you need the pointer to the ReaderModePrefs? Wo
smaslo
2014/06/27 18:33:18
Done.
| |
| 39 }; | |
| 40 | |
| 41 void AddObserver(Observer* obs); | |
| 42 void RemoveObserver(Observer* obs); | |
| 43 | |
| 44 const char* GetBodyCssClass(); | |
|
nyquist
2014/06/26 20:39:59
Could this method make take in a theme as an argum
smaslo
2014/06/27 18:33:18
I made it a static method rather than a const meth
| |
| 45 Theme GetThemePref(); | |
|
nyquist
2014/06/26 20:39:58
Can this return const and also be const itself?
smaslo
2014/06/27 18:33:18
Done.
| |
| 46 | |
| 47 private: | |
| 48 PrefService* pref_service_; | |
| 49 ObserverList<Observer> observer_list_; | |
| 50 | |
| 51 void NotifyOnChangeTheme(); | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(ReaderModePrefs); | |
| 54 }; | |
| 55 | |
| 56 } // namespace dom_distiller | |
| 57 | |
| 58 #endif // COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_ | |
| OLD | NEW |