| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/cpp/private/pdf.h" | 5 #include "ppapi/cpp/private/pdf.h" |
| 6 | 6 |
| 7 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" | 7 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" |
| 8 #include "ppapi/cpp/image_data.h" | 8 #include "ppapi/cpp/image_data.h" |
| 9 #include "ppapi/cpp/instance_handle.h" | 9 #include "ppapi/cpp/instance_handle.h" |
| 10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return ImageData(PASS_REF, | 43 return ImageData(PASS_REF, |
| 44 get_interface<PPB_PDF>()->GetResourceImage( | 44 get_interface<PPB_PDF>()->GetResourceImage( |
| 45 instance.pp_instance(), image_id)); | 45 instance.pp_instance(), image_id)); |
| 46 } | 46 } |
| 47 return ImageData(); | 47 return ImageData(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 // static | 50 // static |
| 51 PP_Resource PDF::GetFontFileWithFallback( | 51 PP_Resource PDF::GetFontFileWithFallback( |
| 52 const InstanceHandle& instance, | 52 const InstanceHandle& instance, |
| 53 const PP_FontDescription_Dev* description, | |
| 54 PP_PrivateFontCharset charset) { | |
| 55 if (has_interface<PPB_PDF>()) { | |
| 56 PP_BrowserFont_Trusted_Description converted_desc; | |
| 57 converted_desc.face = description->face; | |
| 58 converted_desc.family = static_cast<PP_BrowserFont_Trusted_Family>( | |
| 59 description->family); | |
| 60 converted_desc.size = description->size; | |
| 61 converted_desc.weight = static_cast<PP_BrowserFont_Trusted_Weight>( | |
| 62 description->weight); | |
| 63 converted_desc.italic = description->italic; | |
| 64 converted_desc.small_caps = description->small_caps; | |
| 65 converted_desc.letter_spacing = description->letter_spacing; | |
| 66 converted_desc.word_spacing = description->word_spacing; | |
| 67 return get_interface<PPB_PDF>()->GetFontFileWithFallback( | |
| 68 instance.pp_instance(), &converted_desc, charset); | |
| 69 } | |
| 70 return 0; | |
| 71 } | |
| 72 | |
| 73 // static | |
| 74 PP_Resource PDF::GetFontFileWithFallback( | |
| 75 const InstanceHandle& instance, | |
| 76 const PP_BrowserFont_Trusted_Description* description, | 53 const PP_BrowserFont_Trusted_Description* description, |
| 77 PP_PrivateFontCharset charset) { | 54 PP_PrivateFontCharset charset) { |
| 78 if (has_interface<PPB_PDF>()) { | 55 if (has_interface<PPB_PDF>()) { |
| 79 return get_interface<PPB_PDF>()->GetFontFileWithFallback( | 56 return get_interface<PPB_PDF>()->GetFontFileWithFallback( |
| 80 instance.pp_instance(), description, charset); | 57 instance.pp_instance(), description, charset); |
| 81 } | 58 } |
| 82 return 0; | 59 return 0; |
| 83 } | 60 } |
| 84 | 61 |
| 85 // static | 62 // static |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 191 } |
| 215 } | 192 } |
| 216 | 193 |
| 217 // static | 194 // static |
| 218 void PDF::SetLinkUnderCursor(const InstanceHandle& instance, const char* url) { | 195 void PDF::SetLinkUnderCursor(const InstanceHandle& instance, const char* url) { |
| 219 if (has_interface<PPB_PDF>()) | 196 if (has_interface<PPB_PDF>()) |
| 220 get_interface<PPB_PDF>()->SetLinkUnderCursor(instance.pp_instance(), url); | 197 get_interface<PPB_PDF>()->SetLinkUnderCursor(instance.pp_instance(), url); |
| 221 } | 198 } |
| 222 | 199 |
| 223 } // namespace pp | 200 } // namespace pp |
| OLD | NEW |