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 { | |
|
nyquist
2014/06/30 21:35:41
Rename this across the board to DistilledPagePrefs
smaslo
2014/07/07 17:14:15
I removed it from the code and the issue descripti
| |
| 21 public: | |
| 22 // Possible themes for reader mode. | |
| 23 enum Theme { | |
| 24 kLight, | |
| 25 kDark, | |
| 26 kSepia | |
| 27 }; | |
| 28 | |
| 29 class Observer { | |
| 30 public: | |
| 31 virtual void OnChangeTheme(Theme theme) = 0; | |
| 32 }; | |
| 33 | |
| 34 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | |
| 35 | |
| 36 void AddObserver(Observer* obs); | |
| 37 void RemoveObserver(Observer* obs); | |
| 38 | |
| 39 explicit ReaderModePrefs(PrefService* pref_service); | |
| 40 ~ReaderModePrefs(); | |
| 41 | |
| 42 void SetTheme(Theme new_theme); | |
| 43 | |
| 44 const Theme GetTheme() const; | |
| 45 | |
| 46 private: | |
| 47 // Notifies all Observers of new theme. | |
| 48 void NotifyOnChangeTheme(Theme theme); | |
| 49 | |
| 50 PrefService* pref_service_; | |
| 51 ObserverList<Observer> observers_; | |
| 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 |