Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1004)

Side by Side Diff: components/dom_distiller/core/reader_mode_preferences.h

Issue 341563002: Theme Preferences for Distilled Pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments from Patch 15 Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698