| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/prefs/public/pref_observer.h" | |
| 10 #include "chrome/browser/api/prefs/pref_member.h" | 9 #include "chrome/browser/api/prefs/pref_member.h" |
| 11 #include "chrome/browser/ui/webui/options/options_ui.h" | 10 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 12 | 11 |
| 13 namespace base { | 12 namespace base { |
| 14 class ListValue; | 13 class ListValue; |
| 15 } | 14 } |
| 16 | 15 |
| 17 namespace options { | 16 namespace options { |
| 18 | 17 |
| 19 // Font settings overlay page UI handler. | 18 // Font settings overlay page UI handler. |
| 20 class FontSettingsHandler : public OptionsPageUIHandler, | 19 class FontSettingsHandler : public OptionsPageUIHandler { |
| 21 public PrefObserver { | |
| 22 public: | 20 public: |
| 23 FontSettingsHandler(); | 21 FontSettingsHandler(); |
| 24 virtual ~FontSettingsHandler(); | 22 virtual ~FontSettingsHandler(); |
| 25 | 23 |
| 26 // OptionsPageUIHandler implementation. | 24 // OptionsPageUIHandler implementation. |
| 27 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | 25 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; |
| 28 virtual void InitializePage() OVERRIDE; | 26 virtual void InitializePage() OVERRIDE; |
| 29 | 27 |
| 30 // WebUIMessageHandler implementation. | 28 // WebUIMessageHandler implementation. |
| 31 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() OVERRIDE; |
| 32 | 30 |
| 33 // PrefObserver implementation. | |
| 34 virtual void OnPreferenceChanged(PrefServiceBase* service, | |
| 35 const std::string& pref_name) OVERRIDE; | |
| 36 | |
| 37 private: | 31 private: |
| 38 void HandleFetchFontsData(const ListValue* args); | 32 void HandleFetchFontsData(const ListValue* args); |
| 39 | 33 |
| 40 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); | 34 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); |
| 41 | 35 |
| 42 void SetUpStandardFontSample(); | 36 void SetUpStandardFontSample(); |
| 43 void SetUpSerifFontSample(); | 37 void SetUpSerifFontSample(); |
| 44 void SetUpSansSerifFontSample(); | 38 void SetUpSansSerifFontSample(); |
| 45 void SetUpFixedFontSample(); | 39 void SetUpFixedFontSample(); |
| 46 void SetUpMinimumFontSample(); | 40 void SetUpMinimumFontSample(); |
| 41 void OnWebKitDefaultFontSizeChanged(); |
| 47 | 42 |
| 48 StringPrefMember standard_font_; | 43 StringPrefMember standard_font_; |
| 49 StringPrefMember serif_font_; | 44 StringPrefMember serif_font_; |
| 50 StringPrefMember sans_serif_font_; | 45 StringPrefMember sans_serif_font_; |
| 51 StringPrefMember fixed_font_; | 46 StringPrefMember fixed_font_; |
| 52 StringPrefMember font_encoding_; | 47 StringPrefMember font_encoding_; |
| 53 IntegerPrefMember default_font_size_; | 48 IntegerPrefMember default_font_size_; |
| 54 IntegerPrefMember default_fixed_font_size_; | 49 IntegerPrefMember default_fixed_font_size_; |
| 55 IntegerPrefMember minimum_font_size_; | 50 IntegerPrefMember minimum_font_size_; |
| 56 | 51 |
| 57 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); | 52 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); |
| 58 }; | 53 }; |
| 59 | 54 |
| 60 } // namespace options | 55 } // namespace options |
| 61 | 56 |
| 62 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ | 57 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ |
| OLD | NEW |