| 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" |
| 11 #include "ppapi/cpp/var.h" | 11 #include "ppapi/cpp/var.h" |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 template <> const char* interface_name<PPB_PDF>() { | 17 template <> const char* interface_name<PPB_PDF>() { |
| 18 return PPB_PDF_INTERFACE; | 18 return PPB_PDF_INTERFACE; |
| 19 } | 19 } |
| 20 | 20 |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 bool PDF::IsAvailable() { | 24 bool PDF::IsAvailable() { |
| 25 return has_interface<PPB_PDF>(); | 25 return has_interface<PPB_PDF>(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 // static | 28 // static |
| 29 Var PDF::GetLocalizedString(const InstanceHandle& instance, | |
| 30 PP_ResourceString string_id) { | |
| 31 if (has_interface<PPB_PDF>()) { | |
| 32 return Var(PASS_REF, | |
| 33 get_interface<PPB_PDF>()->GetLocalizedString( | |
| 34 instance.pp_instance(), string_id)); | |
| 35 } | |
| 36 return Var(); | |
| 37 } | |
| 38 | |
| 39 // static | |
| 40 PP_Resource PDF::GetFontFileWithFallback( | 29 PP_Resource PDF::GetFontFileWithFallback( |
| 41 const InstanceHandle& instance, | 30 const InstanceHandle& instance, |
| 42 const PP_BrowserFont_Trusted_Description* description, | 31 const PP_BrowserFont_Trusted_Description* description, |
| 43 PP_PrivateFontCharset charset) { | 32 PP_PrivateFontCharset charset) { |
| 44 if (has_interface<PPB_PDF>()) { | 33 if (has_interface<PPB_PDF>()) { |
| 45 return get_interface<PPB_PDF>()->GetFontFileWithFallback( | 34 return get_interface<PPB_PDF>()->GetFontFileWithFallback( |
| 46 instance.pp_instance(), description, charset); | 35 instance.pp_instance(), description, charset); |
| 47 } | 36 } |
| 48 return 0; | 37 return 0; |
| 49 } | 38 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 snapshot_size_out); | 146 snapshot_size_out); |
| 158 return; | 147 return; |
| 159 } | 148 } |
| 160 *natives_data_out = NULL; | 149 *natives_data_out = NULL; |
| 161 *snapshot_data_out = NULL; | 150 *snapshot_data_out = NULL; |
| 162 *natives_size_out = 0; | 151 *natives_size_out = 0; |
| 163 *snapshot_size_out = 0; | 152 *snapshot_size_out = 0; |
| 164 } | 153 } |
| 165 | 154 |
| 166 } // namespace pp | 155 } // namespace pp |
| OLD | NEW |