| Index: chrome/browser/ui/webui/settings/font_handler.h
|
| diff --git a/chrome/browser/ui/webui/settings/font_handler.h b/chrome/browser/ui/webui/settings/font_handler.h
|
| index 20a62ca086cdde377c7368db3ebcf798a9390e80..b3ea9e08d9a7f97909423812aef55b7620fc711e 100644
|
| --- a/chrome/browser/ui/webui/settings/font_handler.h
|
| +++ b/chrome/browser/ui/webui/settings/font_handler.h
|
| @@ -10,7 +10,9 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "base/scoped_observer.h"
|
| #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
|
| +#include "extensions/browser/extension_registry_observer.h"
|
|
|
| namespace base {
|
| class ListValue;
|
| @@ -20,27 +22,57 @@ namespace content {
|
| class WebUI;
|
| }
|
|
|
| +namespace extensions {
|
| +class Extension;
|
| +class ExtensionRegistry;
|
| +}
|
| +
|
| class Profile;
|
|
|
| namespace settings {
|
|
|
| // Handle OS font list, font preference settings and character encoding.
|
| -class FontHandler : public SettingsPageUIHandler {
|
| +class FontHandler : public SettingsPageUIHandler,
|
| + public extensions::ExtensionRegistryObserver {
|
| public:
|
| explicit FontHandler(content::WebUI* webui);
|
| ~FontHandler() override;
|
|
|
| // SettingsPageUIHandler implementation.
|
| void RegisterMessages() override;
|
| + void RenderViewReused() override;
|
| +
|
| + // ExtensionRegistryObserver implementation.
|
| + void OnExtensionLoaded(content::BrowserContext* browser_context,
|
| + const extensions::Extension* extension) override;
|
| + void OnExtensionUnloaded(
|
| + content::BrowserContext* browser_context,
|
| + const extensions::Extension* extension,
|
| + extensions::UnloadedExtensionInfo::Reason reason) override;
|
|
|
| private:
|
| // Handler for script asking for font information.
|
| void HandleFetchFontsData(const base::ListValue* args);
|
|
|
| + // Listen for changes to whether the advanced font extension is available.
|
| + // An initial update will be sent when observation begins.
|
| + void HandleObserveAdvancedFontExtensionAvailable(const base::ListValue* args);
|
| +
|
| + // Open the advanced font settings page.
|
| + void HandleOpenAdvancedFontSettings(const base::ListValue* args);
|
| +
|
| // Callback to handle fonts loading.
|
| void FontListHasLoaded(std::string callback_id,
|
| std::unique_ptr<base::ListValue> list);
|
|
|
| + const extensions::Extension* GetAdvancedFontSettingsExtension();
|
| +
|
| + void NotifyAdvancedFontSettingsAvailability();
|
| +
|
| + ScopedObserver<extensions::ExtensionRegistry,
|
| + extensions::ExtensionRegistryObserver>
|
| + extension_registry_observer_;
|
| +
|
| Profile* profile_; // Weak pointer.
|
|
|
| base::WeakPtrFactory<FontHandler> weak_ptr_factory_;
|
|
|