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 // Defines the classes to realize the Font Settings Extension API as specified | 5 // Defines the classes to realize the Font Settings Extension API as specified |
6 // in the extension API JSON. | 6 // in the extension API JSON. |
7 | 7 |
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_ |
9 #define CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_ |
10 | 10 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // fontSettings.getFontList API function. | 135 // fontSettings.getFontList API function. |
136 class FontSettingsGetFontListFunction : public ChromeAsyncExtensionFunction { | 136 class FontSettingsGetFontListFunction : public ChromeAsyncExtensionFunction { |
137 public: | 137 public: |
138 DECLARE_EXTENSION_FUNCTION("fontSettings.getFontList", | 138 DECLARE_EXTENSION_FUNCTION("fontSettings.getFontList", |
139 FONTSETTINGS_GETFONTLIST) | 139 FONTSETTINGS_GETFONTLIST) |
140 | 140 |
141 protected: | 141 protected: |
142 virtual ~FontSettingsGetFontListFunction() {} | 142 virtual ~FontSettingsGetFontListFunction() {} |
143 | 143 |
144 // ExtensionFunction: | 144 // ExtensionFunction: |
145 virtual bool RunImpl() OVERRIDE; | 145 virtual bool RunAsync() OVERRIDE; |
146 | 146 |
147 private: | 147 private: |
148 void FontListHasLoaded(scoped_ptr<base::ListValue> list); | 148 void FontListHasLoaded(scoped_ptr<base::ListValue> list); |
149 bool CopyFontsToResult(base::ListValue* fonts); | 149 bool CopyFontsToResult(base::ListValue* fonts); |
150 }; | 150 }; |
151 | 151 |
152 // Base class for extension API functions that clear a browser font pref. | 152 // Base class for extension API functions that clear a browser font pref. |
153 class ClearFontPrefExtensionFunction : public ChromeSyncExtensionFunction { | 153 class ClearFontPrefExtensionFunction : public ChromeSyncExtensionFunction { |
154 protected: | 154 protected: |
155 virtual ~ClearFontPrefExtensionFunction() {} | 155 virtual ~ClearFontPrefExtensionFunction() {} |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 virtual ~FontSettingsSetMinimumFontSizeFunction() {} | 318 virtual ~FontSettingsSetMinimumFontSizeFunction() {} |
319 | 319 |
320 // SetFontPrefExtensionFunction: | 320 // SetFontPrefExtensionFunction: |
321 virtual const char* GetPrefName() OVERRIDE; | 321 virtual const char* GetPrefName() OVERRIDE; |
322 virtual const char* GetKey() OVERRIDE; | 322 virtual const char* GetKey() OVERRIDE; |
323 }; | 323 }; |
324 | 324 |
325 } // namespace extensions | 325 } // namespace extensions |
326 | 326 |
327 #endif // CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_ | 327 #endif // CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_ |
OLD | NEW |