Index: chrome/browser/accessibility/font_size_prefs.h |
diff --git a/chrome/browser/accessibility/font_size_prefs.h b/chrome/browser/accessibility/font_size_prefs.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f12e6ae13f90251595238277824efc3e5ac68d2c |
--- /dev/null |
+++ b/chrome/browser/accessibility/font_size_prefs.h |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 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 CHROME_BROWSER_ACCESSIBILITY_FONT_SIZE_PREFS_H_ |
+#define CHROME_BROWSER_ACCESSIBILITY_FONT_SIZE_PREFS_H_ |
+ |
+#include "base/observer_list.h" |
+ |
+class PrefChangeRegistrar; |
+class PrefService; |
+class Profile; |
+ |
+class FontSizePrefs { |
+ public: |
+ class Observer { |
+ public: |
+ virtual void OnChangeFontSize(float font) = 0; |
+ virtual void OnChangeForceEnableZoom(bool enabled) = 0; |
+ }; |
+ |
+ explicit FontSizePrefs(Profile* profile); |
+ ~FontSizePrefs(); |
+ void Destroy(); |
+ |
+ // Sets the font scale factor. |
+ void SetFontScaleFactor(float font); |
+ float GetFontScaleFactor(); |
+ |
+ // Sets Force Enable Zoom. |
+ void SetForceEnableZoom(bool enabled); |
+ bool GetForceEnableZoom(); |
+ |
+ void AddObserver(Observer* obs); |
+ void RemoveObserver(Observer* obs); |
+ |
+ private: |
+ scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; |
robliao
2014/07/25 23:49:34
Declaration order - These go last, but before the
sunangel
2014/07/28 21:17:20
Done.
|
+ PrefService* pref_service_; |
+ ObserverList<Observer> observers_; |
+ |
+ // Callback for FontScaleFactor changes from pref change registrar. |
+ void OnFontScaleFactorPrefsChanged(); |
+ // Callback for ForceEnableZoom changes from pref change registrar. |
+ void OnForceEnableZoomPrefsChanged(); |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FontSizePrefs); |
+}; |
+ |
+#endif // CHROME_BROWSER_ACCESSIBILITY_FONT_SIZE_PREFS_H_ |