Index: ppapi/cpp/private/flash_font_file.cc |
diff --git a/ppapi/cpp/private/flash_font_file.cc b/ppapi/cpp/private/flash_font_file.cc |
index df11f57d741c7dec9403a1a1cf9d0b2609c773eb..26b33a9d3ad4a6ea15fccd48ecf2d9de095be24c 100644 |
--- a/ppapi/cpp/private/flash_font_file.cc |
+++ b/ppapi/cpp/private/flash_font_file.cc |
@@ -18,6 +18,10 @@ template <> const char* interface_name<PPB_Flash_FontFile_0_1>() { |
return PPB_FLASH_FONTFILE_INTERFACE_0_1; |
} |
+template <> const char* interface_name<PPB_Flash_FontFile_0_2>() { |
+ return PPB_FLASH_FONTFILE_INTERFACE_0_2; |
+} |
+ |
} // namespace |
namespace flash { |
@@ -28,7 +32,11 @@ FontFile::FontFile() { |
FontFile::FontFile(const InstanceHandle& instance, |
const PP_BrowserFont_Trusted_Description* description, |
PP_PrivateFontCharset charset) { |
- if (has_interface<PPB_Flash_FontFile_0_1>()) { |
+ if (has_interface<PPB_Flash_FontFile_0_2>()) { |
+ PassRefFromConstructor(get_interface<PPB_Flash_FontFile_0_2>()->Create( |
+ instance.pp_instance(), description, charset)); |
+ } |
+ else if (has_interface<PPB_Flash_FontFile_0_1>()) { |
PassRefFromConstructor(get_interface<PPB_Flash_FontFile_0_1>()->Create( |
instance.pp_instance(), description, charset)); |
} |
@@ -39,13 +47,24 @@ FontFile::~FontFile() { |
// static |
bool FontFile::IsAvailable() { |
- return has_interface<PPB_Flash_FontFile_0_1>(); |
+ return (has_interface<PPB_Flash_FontFile_0_2>() || |
+ has_interface<PPB_Flash_FontFile_0_1>()); |
+} |
+ |
+bool FontFile::IsSupportedForWindows() { |
+ if (has_interface<PPB_Flash_FontFile_0_2>()) |
+ return !!get_interface<PPB_Flash_FontFile_0_2>()->IsSupportedForWindows(); |
+ return false; |
} |
bool FontFile::GetFontTable(uint32_t table, |
void* output, |
uint32_t* output_length) { |
- if (has_interface<PPB_Flash_FontFile_0_1>()) { |
+ if (has_interface<PPB_Flash_FontFile_0_2>()) { |
+ return !!get_interface<PPB_Flash_FontFile_0_2>()-> |
+ GetFontTable(pp_resource(), table, output, output_length); |
+ } |
+ else if (has_interface<PPB_Flash_FontFile_0_1>()) { |
return !!get_interface<PPB_Flash_FontFile_0_1>()-> |
GetFontTable(pp_resource(), table, output, output_length); |
} |