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 #include "chrome/renderer/pepper/pepper_flash_font_file_host.h" | 5 #include "chrome/renderer/pepper/pepper_flash_font_file_host.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "content/public/renderer/renderer_ppapi_host.h" | 8 #include "content/public/renderer/renderer_ppapi_host.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/host/dispatch_host_message.h" | 10 #include "ppapi/host/dispatch_host_message.h" |
11 #include "ppapi/host/host_message_context.h" | 11 #include "ppapi/host/host_message_context.h" |
12 #include "ppapi/host/ppapi_host.h" | 12 #include "ppapi/host/ppapi_host.h" |
13 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
14 #include "ppapi/proxy/serialized_structs.h" | 14 #include "ppapi/proxy/serialized_structs.h" |
15 | 15 |
16 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 16 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
17 #include "content/public/common/child_process_sandbox_support_linux.h" | 17 #include "content/public/common/child_process_sandbox_support_linux.h" |
18 #endif | 18 #endif |
19 | 19 |
20 PepperFlashFontFileHost::PepperFlashFontFileHost( | 20 PepperFlashFontFileHost::PepperFlashFontFileHost( |
21 content::RendererPpapiHost* host, | 21 content::RendererPpapiHost* host, |
22 PP_Instance instance, | 22 PP_Instance instance, |
23 PP_Resource resource, | 23 PP_Resource resource, |
24 const ppapi::proxy::SerializedFontDescription& description, | 24 const ppapi::proxy::SerializedFontDescription& description, |
25 PP_PrivateFontCharset charset) | 25 PP_PrivateFontCharset charset) |
26 : ResourceHost(host->GetPpapiHost(), instance, resource) { | 26 : ResourceHost(host->GetPpapiHost(), instance, resource) { |
27 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 27 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
28 fd_.reset(content::MatchFontWithFallback( | 28 fd_.reset(content::MatchFontWithFallback( |
29 description.face.c_str(), | 29 description.face, |
30 description.weight >= PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD, | 30 description.weight >= PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD, |
31 description.italic, | 31 description.italic, |
32 charset, | 32 charset, |
33 PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT)); | 33 PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT)); |
34 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) | 34 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) |
35 } | 35 } |
36 | 36 |
37 PepperFlashFontFileHost::~PepperFlashFontFileHost() {} | 37 PepperFlashFontFileHost::~PepperFlashFontFileHost() {} |
38 | 38 |
39 int32_t PepperFlashFontFileHost::OnResourceMessageReceived( | 39 int32_t PepperFlashFontFileHost::OnResourceMessageReceived( |
(...skipping 25 matching lines...) Expand all Loading... |
65 } else { | 65 } else { |
66 contents.clear(); | 66 contents.clear(); |
67 } | 67 } |
68 } | 68 } |
69 } | 69 } |
70 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) | 70 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) |
71 | 71 |
72 context->reply_msg = PpapiPluginMsg_FlashFontFile_GetFontTableReply(contents); | 72 context->reply_msg = PpapiPluginMsg_FlashFontFile_GetFontTableReply(contents); |
73 return result; | 73 return result; |
74 } | 74 } |
OLD | NEW |