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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
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..607d66e2f45b5e7f289710a5f4ff0d9553491cd8
--- /dev/null
+++ b/components/dom_distiller/core/reader_mode_preferences.h
@@ -0,0 +1,58 @@
+// 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 {
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
+ public:
+ // Possible themes for reader mode.
+ enum Theme {
+ kLight,
+ kDark,
+ kSepia
+ };
+
+ class Observer {
+ public:
+ virtual void OnChangeTheme(Theme theme) = 0;
+ };
+
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
+ void AddObserver(Observer* obs);
+ void RemoveObserver(Observer* obs);
+
+ explicit ReaderModePrefs(PrefService* pref_service);
+ ~ReaderModePrefs();
+
+ void SetTheme(Theme new_theme);
+
+ const Theme GetTheme() const;
+
+ private:
+ // Notifies all Observers of new theme.
+ void NotifyOnChangeTheme(Theme theme);
+
+ PrefService* pref_service_;
+ ObserverList<Observer> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(ReaderModePrefs);
+};
+
+} // namespace dom_distiller
+
+#endif // COMPONENTS_DOM_DISTILLER_CORE_READER_MODE_PREFERENCES_H_

Powered by Google App Engine
This is Rietveld 408576698