Chromium Code Reviews| 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" | |
| 9 #include "chrome/browser/api/prefs/pref_member.h" | 10 #include "chrome/browser/api/prefs/pref_member.h" |
| 10 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 class ListValue; | 14 class ListValue; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace options { | 17 namespace options { |
| 17 | 18 |
| 18 // Font settings overlay page UI handler. | 19 // Font settings overlay page UI handler. |
| 19 class FontSettingsHandler : public OptionsPageUIHandler { | 20 class FontSettingsHandler |
| 21 : public OptionsPageUIHandler, | |
| 22 public PrefObserver { | |
|
Mattias Nissler (ping if slow)
2012/10/31 13:29:36
why reformatted (also in a few other places)?
Jói
2012/10/31 14:56:26
Ditto.
| |
| 20 public: | 23 public: |
| 21 FontSettingsHandler(); | 24 FontSettingsHandler(); |
| 22 virtual ~FontSettingsHandler(); | 25 virtual ~FontSettingsHandler(); |
| 23 | 26 |
| 24 // OptionsPageUIHandler implementation. | 27 // OptionsPageUIHandler implementation. |
| 25 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | 28 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; |
| 26 virtual void InitializePage() OVERRIDE; | 29 virtual void InitializePage() OVERRIDE; |
| 27 | 30 |
| 28 // WebUIMessageHandler implementation. | 31 // WebUIMessageHandler implementation. |
| 29 virtual void RegisterMessages() OVERRIDE; | 32 virtual void RegisterMessages() OVERRIDE; |
| 30 | 33 |
| 31 // content::NotificationObserver implementation. | 34 // PrefObserver implementation. |
| 32 virtual void Observe(int type, | 35 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 33 const content::NotificationSource& source, | 36 const std::string& pref_name) OVERRIDE; |
| 34 const content::NotificationDetails& details) OVERRIDE; | |
| 35 | 37 |
| 36 private: | 38 private: |
| 37 void HandleFetchFontsData(const ListValue* args); | 39 void HandleFetchFontsData(const ListValue* args); |
| 38 | 40 |
| 39 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); | 41 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); |
| 40 | 42 |
| 41 void SetUpStandardFontSample(); | 43 void SetUpStandardFontSample(); |
| 42 void SetUpSerifFontSample(); | 44 void SetUpSerifFontSample(); |
| 43 void SetUpSansSerifFontSample(); | 45 void SetUpSansSerifFontSample(); |
| 44 void SetUpFixedFontSample(); | 46 void SetUpFixedFontSample(); |
| 45 void SetUpMinimumFontSample(); | 47 void SetUpMinimumFontSample(); |
| 46 | 48 |
| 47 StringPrefMember standard_font_; | 49 StringPrefMember standard_font_; |
| 48 StringPrefMember serif_font_; | 50 StringPrefMember serif_font_; |
| 49 StringPrefMember sans_serif_font_; | 51 StringPrefMember sans_serif_font_; |
| 50 StringPrefMember fixed_font_; | 52 StringPrefMember fixed_font_; |
| 51 StringPrefMember font_encoding_; | 53 StringPrefMember font_encoding_; |
| 52 IntegerPrefMember default_font_size_; | 54 IntegerPrefMember default_font_size_; |
| 53 IntegerPrefMember default_fixed_font_size_; | 55 IntegerPrefMember default_fixed_font_size_; |
| 54 IntegerPrefMember minimum_font_size_; | 56 IntegerPrefMember minimum_font_size_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); | 58 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace options | 61 } // namespace options |
| 60 | 62 |
| 61 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ | 63 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ |
| OLD | NEW |