OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_FONT_SETTINGS_HANDLER_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_FONT_SETTINGS_HANDLER_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/prefs/pref_member.h" | |
10 #include "chrome/browser/ui/webui/options2/options_ui.h" | |
11 #include "content/browser/font_list_async.h" | |
12 | |
13 // Font settings overlay page UI handler. | |
14 class FontSettingsHandler : public OptionsPage2UIHandler { | |
15 public: | |
16 FontSettingsHandler(); | |
17 virtual ~FontSettingsHandler(); | |
18 | |
19 // OptionsPage2UIHandler implementation. | |
20 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | |
21 virtual void Initialize() OVERRIDE; | |
22 | |
23 // WebUIMessageHandler implementation. | |
24 virtual WebUIMessageHandler* Attach(WebUI* web_ui) OVERRIDE; | |
25 virtual void RegisterMessages() OVERRIDE; | |
26 | |
27 // content::NotificationObserver implementation. | |
28 virtual void Observe(int type, | |
29 const content::NotificationSource& source, | |
30 const content::NotificationDetails& details) OVERRIDE; | |
31 | |
32 private: | |
33 void HandleFetchFontsData(const ListValue* args); | |
34 | |
35 void FontsListHasLoaded(scoped_refptr<content::FontListResult> list); | |
36 | |
37 void SetUpStandardFontSample(); | |
38 void SetUpSerifFontSample(); | |
39 void SetUpSansSerifFontSample(); | |
40 void SetUpFixedFontSample(); | |
41 void SetUpMinimumFontSample(); | |
42 | |
43 StringPrefMember standard_font_; | |
44 StringPrefMember serif_font_; | |
45 StringPrefMember sans_serif_font_; | |
46 StringPrefMember fixed_font_; | |
47 StringPrefMember font_encoding_; | |
48 IntegerPrefMember default_font_size_; | |
49 IntegerPrefMember default_fixed_font_size_; | |
50 IntegerPrefMember minimum_font_size_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); | |
53 }; | |
54 | |
55 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_FONT_SETTINGS_HANDLER_H_ | |
OLD | NEW |