| Index: ppapi/cpp/private/flash.cc
|
| diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc
|
| index bab400b8cb4e91079b7006cbad7774c43a568bb9..f9ba3d369a6a4624a6f296c38f41755bd701ede4 100644
|
| --- a/ppapi/cpp/private/flash.cc
|
| +++ b/ppapi/cpp/private/flash.cc
|
| @@ -25,6 +25,10 @@ template <> const char* interface_name<PPB_Flash>() {
|
| return PPB_FLASH_INTERFACE;
|
| }
|
|
|
| +template <> const char* interface_name<PPB_Flash_12_0>() {
|
| + return PPB_FLASH_INTERFACE_12_0;
|
| +}
|
| +
|
| template <> const char* interface_name<PPB_Flash_11>() {
|
| return PPB_FLASH_INTERFACE_11_0;
|
| }
|
| @@ -35,7 +39,9 @@ namespace flash {
|
|
|
| // static
|
| bool Flash::IsAvailable() {
|
| - return has_interface<PPB_Flash>() || has_interface<PPB_Flash_11>();
|
| + return has_interface<PPB_Flash>() ||
|
| + has_interface<PPB_Flash_12_0>();
|
| + has_interface<PPB_Flash_11>();
|
| }
|
|
|
| // static
|
| @@ -43,6 +49,9 @@ void Flash::SetInstanceAlwaysOnTop(Instance* instance, bool on_top) {
|
| if (has_interface<PPB_Flash>()) {
|
| get_interface<PPB_Flash>()->SetInstanceAlwaysOnTop(instance->pp_instance(),
|
| PP_FromBool(on_top));
|
| + } else if (has_interface<PPB_Flash_12_0>()) {
|
| + get_interface<PPB_Flash_12_0>()->SetInstanceAlwaysOnTop(
|
| + instance->pp_instance(), PP_FromBool(on_top));
|
| } else if (has_interface<PPB_Flash_11>()) {
|
| get_interface<PPB_Flash_11>()->SetInstanceAlwaysOnTop(
|
| instance->pp_instance(), PP_FromBool(on_top));
|
| @@ -75,6 +84,19 @@ bool Flash::DrawGlyphs(Instance* instance,
|
| glyph_count,
|
| glyph_indices,
|
| glyph_advances));
|
| + } else if (has_interface<PPB_Flash_12_0>()) {
|
| + rv = PP_ToBool(get_interface<PPB_Flash_12_0>()->DrawGlyphs(
|
| + instance->pp_instance(),
|
| + image->pp_resource(),
|
| + &font_desc.pp_font_description(),
|
| + color,
|
| + &position.pp_point(),
|
| + &clip.pp_rect(),
|
| + transformation,
|
| + PP_FromBool(allow_subpixel_aa),
|
| + glyph_count,
|
| + glyph_indices,
|
| + glyph_advances));
|
| } else if (has_interface<PPB_Flash_11>()) {
|
| rv = PP_ToBool(get_interface<PPB_Flash_11>()->DrawGlyphs(
|
| instance->pp_instance(),
|
| @@ -98,6 +120,10 @@ Var Flash::GetProxyForURL(Instance* instance, const std::string& url) {
|
| rv = Var(Var::PassRef(),
|
| get_interface<PPB_Flash>()->GetProxyForURL(instance->pp_instance(),
|
| url.c_str()));
|
| + } else if (has_interface<PPB_Flash_12_0>()) {
|
| + rv = Var(Var::PassRef(),
|
| + get_interface<PPB_Flash_12_0>()->GetProxyForURL(
|
| + instance->pp_instance(), url.c_str()));
|
| } else if (has_interface<PPB_Flash_11>()) {
|
| rv = Var(Var::PassRef(),
|
| get_interface<PPB_Flash_11>()->GetProxyForURL(
|
| @@ -115,6 +141,11 @@ int32_t Flash::Navigate(const URLRequestInfo& request_info,
|
| rv = get_interface<PPB_Flash>()->Navigate(request_info.pp_resource(),
|
| target.c_str(),
|
| PP_FromBool(from_user_action));
|
| + } else if (has_interface<PPB_Flash_12_0>()) {
|
| + rv = get_interface<PPB_Flash_12_0>()->Navigate(
|
| + request_info.pp_resource(),
|
| + target.c_str(),
|
| + PP_FromBool(from_user_action));
|
| } else if (has_interface<PPB_Flash_11>()) {
|
| rv = get_interface<PPB_Flash_11>()->Navigate(request_info.pp_resource(),
|
| target.c_str(),
|
| @@ -127,6 +158,8 @@ int32_t Flash::Navigate(const URLRequestInfo& request_info,
|
| void Flash::RunMessageLoop(Instance* instance) {
|
| if (has_interface<PPB_Flash>())
|
| get_interface<PPB_Flash>()->RunMessageLoop(instance->pp_instance());
|
| + else if (has_interface<PPB_Flash_12_0>())
|
| + get_interface<PPB_Flash_12_0>()->RunMessageLoop(instance->pp_instance());
|
| else if (has_interface<PPB_Flash_11>())
|
| get_interface<PPB_Flash_11>()->RunMessageLoop(instance->pp_instance());
|
| }
|
| @@ -135,6 +168,8 @@ void Flash::RunMessageLoop(Instance* instance) {
|
| void Flash::QuitMessageLoop(Instance* instance) {
|
| if (has_interface<PPB_Flash>())
|
| get_interface<PPB_Flash>()->QuitMessageLoop(instance->pp_instance());
|
| + else if (has_interface<PPB_Flash_12_0>())
|
| + get_interface<PPB_Flash_12_0>()->QuitMessageLoop(instance->pp_instance());
|
| else if (has_interface<PPB_Flash_11>())
|
| get_interface<PPB_Flash_11>()->QuitMessageLoop(instance->pp_instance());
|
| }
|
| @@ -145,6 +180,9 @@ double Flash::GetLocalTimeZoneOffset(Instance* instance, PP_Time t) {
|
| if (has_interface<PPB_Flash>()) {
|
| rv = get_interface<PPB_Flash>()->GetLocalTimeZoneOffset(
|
| instance->pp_instance(), t);
|
| + } else if (has_interface<PPB_Flash_12_0>()) {
|
| + rv = get_interface<PPB_Flash_12_0>()->GetLocalTimeZoneOffset(
|
| + instance->pp_instance(), t);
|
| } else if (has_interface<PPB_Flash_11>()) {
|
| rv = get_interface<PPB_Flash_11>()->GetLocalTimeZoneOffset(
|
| instance->pp_instance(), t);
|
| @@ -159,6 +197,10 @@ Var Flash::GetCommandLineArgs(Module* module) {
|
| rv = Var(Var::PassRef(),
|
| get_interface<PPB_Flash>()->GetCommandLineArgs(
|
| module->pp_module()));
|
| + } else if (has_interface<PPB_Flash_12_0>()) {
|
| + rv = Var(Var::PassRef(),
|
| + get_interface<PPB_Flash_12_0>()->GetCommandLineArgs(
|
| + module->pp_module()));
|
| } else if (has_interface<PPB_Flash_11>()) {
|
| rv = Var(Var::PassRef(),
|
| get_interface<PPB_Flash_11>()->GetCommandLineArgs(
|
| @@ -171,6 +213,32 @@ Var Flash::GetCommandLineArgs(Module* module) {
|
| void Flash::PreloadFontWin(const void* logfontw) {
|
| if (has_interface<PPB_Flash>())
|
| get_interface<PPB_Flash>()->PreloadFontWin(logfontw);
|
| + else if (has_interface<PPB_Flash_12_0>())
|
| + get_interface<PPB_Flash_12_0>()->PreloadFontWin(logfontw);
|
| +}
|
| +
|
| +// static
|
| +bool Flash::IsRectTopmost(Instance* instance, const Rect& rect) {
|
| + bool rv = false;
|
| + if (has_interface<PPB_Flash>()) {
|
| + rv = PP_ToBool(get_interface<PPB_Flash>()->IsRectTopmost(
|
| + instance->pp_instance(), &rect.pp_rect()));
|
| + }
|
| + return rv;
|
| +}
|
| +
|
| +// static
|
| +int32_t Flash::InvokePrinting(Instance* instance) {
|
| + int32_t rv = PP_ERROR_NOTSUPPORTED;
|
| + if (has_interface<PPB_Flash>())
|
| + rv = get_interface<PPB_Flash>()->InvokePrinting(instance->pp_instance());
|
| + return rv;
|
| +}
|
| +
|
| +// static
|
| +void Flash::UpdateActivity(Instance* instance) {
|
| + if (has_interface<PPB_Flash>())
|
| + get_interface<PPB_Flash>()->UpdateActivity(instance->pp_instance());
|
| }
|
|
|
| } // namespace flash
|
|
|