OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_PROXY_PPB_FONT_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FONT_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_FONT_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FONT_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "ppapi/proxy/host_resource.h" | 10 #include "ppapi/proxy/host_resource.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class PPB_Font_Proxy : public ppapi::FunctionGroupBase, | 23 class PPB_Font_Proxy : public ppapi::FunctionGroupBase, |
24 public ppapi::thunk::PPB_Font_FunctionAPI, | 24 public ppapi::thunk::PPB_Font_FunctionAPI, |
25 public InterfaceProxy { | 25 public InterfaceProxy { |
26 public: | 26 public: |
27 PPB_Font_Proxy(Dispatcher* dispatcher, const void* target_interface); | 27 PPB_Font_Proxy(Dispatcher* dispatcher, const void* target_interface); |
28 virtual ~PPB_Font_Proxy(); | 28 virtual ~PPB_Font_Proxy(); |
29 | 29 |
30 static const Info* GetInfo(); | 30 static const Info* GetInfo(); |
31 | 31 |
32 // FunctionGroupBase overrides. | 32 // FunctionGroupBase overrides. |
33 virtual ppapi::thunk::PPB_Font_FunctionAPI* AsFont_FunctionAPI() OVERRIDE; | 33 virtual ppapi::thunk::PPB_Font_FunctionAPI* AsPPB_Font_FunctionAPI() OVERRIDE; |
34 | 34 |
35 // PPB_Font_FunctionAPI implementation. | 35 // PPB_Font_FunctionAPI implementation. |
36 virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE; | 36 virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE; |
37 | 37 |
38 // InterfaceProxy implementation. | 38 // InterfaceProxy implementation. |
39 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 39 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
40 | 40 |
41 private: | 41 private: |
42 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Proxy); | 42 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Proxy); |
43 }; | 43 }; |
44 | 44 |
45 class Font : public PluginResource, | 45 class Font : public PluginResource, |
46 public ppapi::thunk::PPB_Font_API { | 46 public ppapi::thunk::PPB_Font_API { |
47 public: | 47 public: |
48 // Note that there isn't a "real" resource in the renderer backing a font, | 48 // Note that there isn't a "real" resource in the renderer backing a font, |
49 // it lives entirely in the plugin process. So the resource ID in the host | 49 // it lives entirely in the plugin process. So the resource ID in the host |
50 // resource should be 0. However, various code assumes the instance in the | 50 // resource should be 0. However, various code assumes the instance in the |
51 // host resource is valid (this is how resources are associated with | 51 // host resource is valid (this is how resources are associated with |
52 // instances), so that should be set. | 52 // instances), so that should be set. |
53 Font(const HostResource& resource, const PP_FontDescription_Dev& desc); | 53 Font(const HostResource& resource, const PP_FontDescription_Dev& desc); |
54 virtual ~Font(); | 54 virtual ~Font(); |
55 | 55 |
56 // ResourceObjectBase. | 56 // ResourceObjectBase. |
57 virtual ppapi::thunk::PPB_Font_API* AsFont_API() OVERRIDE; | 57 virtual ppapi::thunk::PPB_Font_API* AsPPB_Font_API() OVERRIDE; |
58 | 58 |
59 // PluginResource overrides. | 59 // PluginResource overrides. |
60 virtual Font* AsFont() OVERRIDE; | 60 virtual Font* AsFont() OVERRIDE; |
61 | 61 |
62 // PPB_Font_API implementation. | 62 // PPB_Font_API implementation. |
63 virtual PP_Bool Describe(PP_FontDescription_Dev* description, | 63 virtual PP_Bool Describe(PP_FontDescription_Dev* description, |
64 PP_FontMetrics_Dev* metrics) OVERRIDE; | 64 PP_FontMetrics_Dev* metrics) OVERRIDE; |
65 virtual PP_Bool DrawTextAt(PP_Resource image_data, | 65 virtual PP_Bool DrawTextAt(PP_Resource image_data, |
66 const PP_TextRun_Dev* text, | 66 const PP_TextRun_Dev* text, |
67 const PP_Point* position, | 67 const PP_Point* position, |
(...skipping 15 matching lines...) Expand all Loading... |
83 | 83 |
84 scoped_ptr<ppapi::WebKitForwarding::Font> font_forwarding_; | 84 scoped_ptr<ppapi::WebKitForwarding::Font> font_forwarding_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(Font); | 86 DISALLOW_COPY_AND_ASSIGN(Font); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace proxy | 89 } // namespace proxy |
90 } // namespace pp | 90 } // namespace pp |
91 | 91 |
92 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ | 92 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ |
OLD | NEW |