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