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/pref_member.h" | 9 #include "base/prefs/pref_member.h" |
10 #include "chrome/browser/ui/webui/options/options_ui.h" | 10 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 11 #include "content/public/browser/notification_observer.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class ListValue; | 14 class ListValue; |
14 } | 15 } |
15 | 16 |
| 17 namespace extensions { |
| 18 class Extension; |
| 19 } |
| 20 |
16 namespace options { | 21 namespace options { |
17 | 22 |
18 // Font settings overlay page UI handler. | 23 // Font settings overlay page UI handler. |
19 class FontSettingsHandler : public OptionsPageUIHandler { | 24 class FontSettingsHandler : public OptionsPageUIHandler { |
20 public: | 25 public: |
21 FontSettingsHandler(); | 26 FontSettingsHandler(); |
22 virtual ~FontSettingsHandler(); | 27 virtual ~FontSettingsHandler(); |
23 | 28 |
24 // OptionsPageUIHandler implementation. | 29 // OptionsPageUIHandler implementation. |
25 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | 30 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; |
| 31 virtual void InitializeHandler() OVERRIDE; |
26 virtual void InitializePage() OVERRIDE; | 32 virtual void InitializePage() OVERRIDE; |
27 | 33 |
28 // WebUIMessageHandler implementation. | 34 // WebUIMessageHandler implementation. |
29 virtual void RegisterMessages() OVERRIDE; | 35 virtual void RegisterMessages() OVERRIDE; |
30 | 36 |
31 private: | 37 private: |
| 38 // content::NotificationObserver (from OptionsPageUIHandler) implementation |
| 39 virtual void Observe(int type, |
| 40 const content::NotificationSource& source, |
| 41 const content::NotificationDetails& details) OVERRIDE; |
| 42 |
32 void HandleFetchFontsData(const ListValue* args); | 43 void HandleFetchFontsData(const ListValue* args); |
33 | 44 |
34 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); | 45 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); |
35 | 46 |
36 void SetUpStandardFontSample(); | 47 void SetUpStandardFontSample(); |
37 void SetUpSerifFontSample(); | 48 void SetUpSerifFontSample(); |
38 void SetUpSansSerifFontSample(); | 49 void SetUpSansSerifFontSample(); |
39 void SetUpFixedFontSample(); | 50 void SetUpFixedFontSample(); |
40 void SetUpMinimumFontSample(); | 51 void SetUpMinimumFontSample(); |
| 52 |
| 53 const extensions::Extension* GetAdvancedFontSettingsExtension(); |
| 54 void NotifyAdvancedFontSettingsAvailability(); |
| 55 void OpenAdvancedFontSettingsOptions(const base::ListValue* args); |
| 56 |
41 void OnWebKitDefaultFontSizeChanged(); | 57 void OnWebKitDefaultFontSizeChanged(); |
42 | 58 |
43 StringPrefMember standard_font_; | 59 StringPrefMember standard_font_; |
44 StringPrefMember serif_font_; | 60 StringPrefMember serif_font_; |
45 StringPrefMember sans_serif_font_; | 61 StringPrefMember sans_serif_font_; |
46 StringPrefMember fixed_font_; | 62 StringPrefMember fixed_font_; |
47 StringPrefMember font_encoding_; | 63 StringPrefMember font_encoding_; |
48 IntegerPrefMember default_font_size_; | 64 IntegerPrefMember default_font_size_; |
49 IntegerPrefMember default_fixed_font_size_; | 65 IntegerPrefMember default_fixed_font_size_; |
50 IntegerPrefMember minimum_font_size_; | 66 IntegerPrefMember minimum_font_size_; |
51 | 67 |
| 68 content::NotificationRegistrar registrar_; |
| 69 |
52 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); | 70 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); |
53 }; | 71 }; |
54 | 72 |
55 } // namespace options | 73 } // namespace options |
56 | 74 |
57 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ | 75 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ |
OLD | NEW |