Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/settings_font_handler.h |
| diff --git a/chrome/browser/ui/webui/settings/settings_font_handler.h b/chrome/browser/ui/webui/settings/settings_font_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c798a93c07feed6fd573b6617a73bdef3d9abb88 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/settings/settings_font_handler.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_FONT_HANDLER_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_FONT_HANDLER_H_ |
| + |
|
Dan Beam
2015/10/15 02:34:41
#include "base/macros.h"
i'm gonna write a presub
dschuyler
2015/10/15 21:54:20
Done.
Dan Beam
2015/10/15 23:33:17
also Done: https://codereview.chromium.org/1411553
dschuyler
2015/10/24 01:03:48
Acknowledged.
|
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/prefs/pref_member.h" |
| +#include "chrome/browser/ui/webui/settings/md_settings_ui.h" |
| + |
| +namespace base { |
| +class ListValue; |
| +} |
| + |
| +namespace content { |
| +class WebUI; |
| +} |
| + |
| +namespace settings { |
| + |
| +// Handle OS font list, font preference settings and character encoding. |
| +class SettingsFontHandler : public SettingsPageUIHandler { |
| + public: |
| + explicit SettingsFontHandler(content::WebUI* webui); |
| + ~SettingsFontHandler() override; |
| + |
| + // SettingsPageUIHandler implementation. |
| + void RegisterMessages() override; |
| + |
| + private: |
| + // Handler for script asking for font information. |
| + void HandleFetchFontsData(const base::ListValue* args); |
| + |
| + // Callback to handle fonts loading. |
| + void FontListHasLoaded(scoped_ptr<base::ListValue> list); |
| + |
| + // Values used to update current settings when lists load. |
| + StringPrefMember standard_font_; |
| + StringPrefMember serif_font_; |
| + StringPrefMember sans_serif_font_; |
| + StringPrefMember fixed_font_; |
| + StringPrefMember font_encoding_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SettingsFontHandler); |
| +}; |
| + |
| +} // namespace settings |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_FONT_HANDLER_H_ |