[email protected] | 2055349 | 2013-02-14 02:06:52 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_ |
| 6 | #define PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_ |
| 7 | |
| 8 | #include "ppapi/proxy/connection.h" |
| 9 | #include "ppapi/proxy/plugin_resource.h" |
| 10 | #include "ppapi/thunk/ppb_browser_font_singleton_api.h" |
| 11 | |
| 12 | namespace ppapi { |
| 13 | namespace proxy { |
| 14 | |
| 15 | // This handles the singleton calls (that don't take a PP_Resource parameter) |
| 16 | // on the browser font interface |
| 17 | class BrowserFontSingletonResource |
| 18 | : public PluginResource, |
| 19 | public thunk::PPB_BrowserFont_Singleton_API { |
| 20 | public: |
| 21 | BrowserFontSingletonResource(Connection connection, PP_Instance instance); |
Peter Boström | 3d5b3cb | 2021-09-23 21:35:45 | [diff] [blame] | 22 | |
| 23 | BrowserFontSingletonResource(const BrowserFontSingletonResource&) = delete; |
| 24 | BrowserFontSingletonResource& operator=(const BrowserFontSingletonResource&) = |
| 25 | delete; |
| 26 | |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 27 | ~BrowserFontSingletonResource() override; |
[email protected] | 2055349 | 2013-02-14 02:06:52 | [diff] [blame] | 28 | |
| 29 | // Resource override. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 30 | thunk::PPB_BrowserFont_Singleton_API* |
mostynb | 699af3c | 2014-10-06 18:03:34 | [diff] [blame] | 31 | AsPPB_BrowserFont_Singleton_API() override; |
[email protected] | 2055349 | 2013-02-14 02:06:52 | [diff] [blame] | 32 | |
| 33 | // thunk::PPB_BrowserFontSingleton_API implementation. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 34 | PP_Var GetFontFamilies(PP_Instance instance) override; |
[email protected] | 2055349 | 2013-02-14 02:06:52 | [diff] [blame] | 35 | |
| 36 | private: |
| 37 | // Lazily-filled-in list of font families. |
| 38 | std::string families_; |
[email protected] | 2055349 | 2013-02-14 02:06:52 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | } // namespace proxy |
| 42 | } // namespace ppapi |
| 43 | |
| 44 | #endif // PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_ |