| 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 "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| 11 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 12 #include "extensions/browser/extension_registry_observer.h" | 12 #include "extensions/browser/extension_registry_observer.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class ListValue; | 15 class ListValue; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace extensions { | 18 namespace extensions { |
| 19 class Extension; | 19 class Extension; |
| 20 class ExtensionRegistry; | 20 class ExtensionRegistry; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace options { | 23 namespace options { |
| 24 | 24 |
| 25 // Font settings overlay page UI handler. | 25 // Font settings overlay page UI handler. |
| 26 class FontSettingsHandler : public OptionsPageUIHandler, | 26 class FontSettingsHandler : public OptionsPageUIHandler, |
| 27 public extensions::ExtensionRegistryObserver { | 27 public extensions::ExtensionRegistryObserver { |
| 28 public: | 28 public: |
| 29 FontSettingsHandler(); | 29 FontSettingsHandler(); |
| 30 virtual ~FontSettingsHandler(); | 30 ~FontSettingsHandler() override; |
| 31 | 31 |
| 32 // OptionsPageUIHandler implementation. | 32 // OptionsPageUIHandler implementation. |
| 33 virtual void GetLocalizedValues( | 33 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
| 34 base::DictionaryValue* localized_strings) override; | 34 void InitializeHandler() override; |
| 35 virtual void InitializeHandler() override; | 35 void InitializePage() override; |
| 36 virtual void InitializePage() override; | |
| 37 | 36 |
| 38 // WebUIMessageHandler implementation. | 37 // WebUIMessageHandler implementation. |
| 39 virtual void RegisterMessages() override; | 38 void RegisterMessages() override; |
| 40 | 39 |
| 41 // ExtensionRegistryObserver implementation. | 40 // ExtensionRegistryObserver implementation. |
| 42 virtual void OnExtensionLoaded( | 41 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 43 content::BrowserContext* browser_context, | 42 const extensions::Extension* extension) override; |
| 44 const extensions::Extension* extension) override; | 43 void OnExtensionUnloaded( |
| 45 virtual void OnExtensionUnloaded( | |
| 46 content::BrowserContext* browser_context, | 44 content::BrowserContext* browser_context, |
| 47 const extensions::Extension* extension, | 45 const extensions::Extension* extension, |
| 48 extensions::UnloadedExtensionInfo::Reason reason) override; | 46 extensions::UnloadedExtensionInfo::Reason reason) override; |
| 49 | 47 |
| 50 private: | 48 private: |
| 51 void HandleFetchFontsData(const base::ListValue* args); | 49 void HandleFetchFontsData(const base::ListValue* args); |
| 52 | 50 |
| 53 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); | 51 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); |
| 54 | 52 |
| 55 void SetUpStandardFontSample(); | 53 void SetUpStandardFontSample(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 81 ScopedObserver<extensions::ExtensionRegistry, | 79 ScopedObserver<extensions::ExtensionRegistry, |
| 82 extensions::ExtensionRegistryObserver> | 80 extensions::ExtensionRegistryObserver> |
| 83 extension_registry_observer_; | 81 extension_registry_observer_; |
| 84 | 82 |
| 85 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); | 83 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); |
| 86 }; | 84 }; |
| 87 | 85 |
| 88 } // namespace options | 86 } // namespace options |
| 89 | 87 |
| 90 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ | 88 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ |
| OLD | NEW |