| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/prefs/pref_member.h" | 10 #include "chrome/browser/prefs/pref_member.h" |
| 11 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 12 #include "content/browser/font_list_async.h" | 12 #include "content/browser/font_list_async.h" |
| 13 | 13 |
| 14 // Font settings overlay page UI handler. | 14 // Font settings overlay page UI handler. |
| 15 class FontSettingsHandler : public base::SupportsWeakPtr<FontSettingsHandler>, | 15 class FontSettingsHandler : public base::SupportsWeakPtr<FontSettingsHandler>, |
| 16 public OptionsPageUIHandler { | 16 public OptionsPageUIHandler { |
| 17 public: | 17 public: |
| 18 FontSettingsHandler(); | 18 FontSettingsHandler(); |
| 19 virtual ~FontSettingsHandler(); | 19 virtual ~FontSettingsHandler(); |
| 20 | 20 |
| 21 // OptionsPageUIHandler implementation. | 21 // OptionsPageUIHandler implementation. |
| 22 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 22 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
| 23 virtual void Initialize(); | 23 virtual void Initialize(); |
| 24 | 24 |
| 25 // WebUIMessageHandler implementation. | 25 // WebUIMessageHandler implementation. |
| 26 virtual WebUIMessageHandler* Attach(WebUI* web_ui); | 26 virtual WebUIMessageHandler* Attach(WebUI* web_ui); |
| 27 virtual void RegisterMessages(); | 27 virtual void RegisterMessages(); |
| 28 | 28 |
| 29 // NotificationObserver implementation. | 29 // NotificationObserver implementation. |
| 30 virtual void Observe(NotificationType type, | 30 virtual void Observe(int type, |
| 31 const NotificationSource& source, | 31 const NotificationSource& source, |
| 32 const NotificationDetails& details); | 32 const NotificationDetails& details); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 void HandleFetchFontsData(const ListValue* args); | 35 void HandleFetchFontsData(const ListValue* args); |
| 36 | 36 |
| 37 void FontsListHasLoaded(scoped_refptr<content::FontListResult> list); | 37 void FontsListHasLoaded(scoped_refptr<content::FontListResult> list); |
| 38 | 38 |
| 39 void SetUpStandardFontSample(); | 39 void SetUpStandardFontSample(); |
| 40 void SetUpSerifFontSample(); | 40 void SetUpSerifFontSample(); |
| 41 void SetUpSansSerifFontSample(); | 41 void SetUpSansSerifFontSample(); |
| 42 void SetUpFixedFontSample(); | 42 void SetUpFixedFontSample(); |
| 43 void SetUpMinimumFontSample(); | 43 void SetUpMinimumFontSample(); |
| 44 | 44 |
| 45 StringPrefMember standard_font_; | 45 StringPrefMember standard_font_; |
| 46 StringPrefMember serif_font_; | 46 StringPrefMember serif_font_; |
| 47 StringPrefMember sans_serif_font_; | 47 StringPrefMember sans_serif_font_; |
| 48 StringPrefMember fixed_font_; | 48 StringPrefMember fixed_font_; |
| 49 StringPrefMember font_encoding_; | 49 StringPrefMember font_encoding_; |
| 50 IntegerPrefMember default_font_size_; | 50 IntegerPrefMember default_font_size_; |
| 51 IntegerPrefMember default_fixed_font_size_; | 51 IntegerPrefMember default_fixed_font_size_; |
| 52 IntegerPrefMember minimum_font_size_; | 52 IntegerPrefMember minimum_font_size_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); | 54 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ | 57 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ |
| OLD | NEW |