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 #include "ppapi/proxy/ppb_font_proxy.h" | 5 #include "ppapi/proxy/ppb_font_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "ppapi/c/dev/ppb_font_dev.h" | 9 #include "ppapi/c/dev/ppb_font_dev.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 StringVar* str = StringVar::FromPPVar(run->text); | 33 StringVar* str = StringVar::FromPPVar(run->text); |
34 if (!str) | 34 if (!str) |
35 return false; | 35 return false; |
36 | 36 |
37 output->text = str->value(); | 37 output->text = str->value(); |
38 output->rtl = PP_ToBool(run->rtl); | 38 output->rtl = PP_ToBool(run->rtl); |
39 output->override_direction = PP_ToBool(run->override_direction); | 39 output->override_direction = PP_ToBool(run->override_direction); |
40 return true; | 40 return true; |
41 } | 41 } |
42 | 42 |
| 43 InterfaceProxy* CreateFontProxy(Dispatcher* dispatcher, |
| 44 const void* target_interface) { |
| 45 return new PPB_Font_Proxy(dispatcher, target_interface); |
| 46 } |
| 47 |
43 } // namespace | 48 } // namespace |
44 | 49 |
45 PPB_Font_Proxy::PPB_Font_Proxy(Dispatcher* dispatcher) | 50 PPB_Font_Proxy::PPB_Font_Proxy(Dispatcher* dispatcher, |
46 : InterfaceProxy(dispatcher) { | 51 const void* target_interface) |
| 52 : InterfaceProxy(dispatcher, target_interface) { |
47 } | 53 } |
48 | 54 |
49 PPB_Font_Proxy::~PPB_Font_Proxy() { | 55 PPB_Font_Proxy::~PPB_Font_Proxy() { |
50 } | 56 } |
51 | 57 |
| 58 // static |
| 59 const InterfaceProxy::Info* PPB_Font_Proxy::GetInfo() { |
| 60 static const Info info = { |
| 61 thunk::GetPPB_Font_Thunk(), |
| 62 PPB_FONT_DEV_INTERFACE, |
| 63 INTERFACE_ID_PPB_FONT, |
| 64 false, |
| 65 &CreateFontProxy, |
| 66 }; |
| 67 return &info; |
| 68 } |
| 69 |
52 PPB_Font_FunctionAPI* PPB_Font_Proxy::AsPPB_Font_FunctionAPI() { | 70 PPB_Font_FunctionAPI* PPB_Font_Proxy::AsPPB_Font_FunctionAPI() { |
53 return this; | 71 return this; |
54 } | 72 } |
55 | 73 |
56 PP_Var PPB_Font_Proxy::GetFontFamilies(PP_Instance instance) { | 74 PP_Var PPB_Font_Proxy::GetFontFamilies(PP_Instance instance) { |
57 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 75 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
58 if (!dispatcher) | 76 if (!dispatcher) |
59 return PP_MakeUndefined(); | 77 return PP_MakeUndefined(); |
60 | 78 |
61 // Assume the font families don't change, so we can cache the result globally. | 79 // Assume the font families don't change, so we can cache the result globally. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 webkit_event_.Wait(); | 226 webkit_event_.Wait(); |
209 } | 227 } |
210 | 228 |
211 // static | 229 // static |
212 void Font::DeleteFontForwarding(WebKitForwarding::Font* font_forwarding) { | 230 void Font::DeleteFontForwarding(WebKitForwarding::Font* font_forwarding) { |
213 delete font_forwarding; | 231 delete font_forwarding; |
214 } | 232 } |
215 | 233 |
216 } // namespace proxy | 234 } // namespace proxy |
217 } // namespace ppapi | 235 } // namespace ppapi |
OLD | NEW |