[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef PPAPI_PROXY_FLASH_RESOURCE_H_ |
| 6 | #define PPAPI_PROXY_FLASH_RESOURCE_H_ |
| 7 | |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
| 10 | #include "base/macros.h" |
[email protected] | a9f2a621 | 2012-12-04 08:47:34 | [diff] [blame] | 11 | #include "ppapi/c/pp_instance.h" |
| 12 | #include "ppapi/c/pp_var.h" |
| 13 | #include "ppapi/c/private/ppb_flash.h" |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 14 | #include "ppapi/proxy/connection.h" |
| 15 | #include "ppapi/proxy/plugin_resource.h" |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 16 | #include "ppapi/thunk/ppb_flash_functions_api.h" |
| 17 | |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 18 | namespace ppapi { |
| 19 | namespace proxy { |
| 20 | |
[email protected] | db16e6d | 2012-12-19 03:32:57 | [diff] [blame] | 21 | class PluginDispatcher; |
| 22 | |
[email protected] | 24f40c1 | 2012-12-19 20:17:42 | [diff] [blame] | 23 | class FlashResource |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 24 | : public PluginResource, |
[email protected] | 24f40c1 | 2012-12-19 20:17:42 | [diff] [blame] | 25 | public thunk::PPB_Flash_Functions_API { |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 26 | public: |
[email protected] | db16e6d | 2012-12-19 03:32:57 | [diff] [blame] | 27 | FlashResource(Connection connection, |
| 28 | PP_Instance instance, |
| 29 | PluginDispatcher* plugin_dispatcher); |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 30 | ~FlashResource() override; |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 31 | |
[email protected] | a9f2a621 | 2012-12-04 08:47:34 | [diff] [blame] | 32 | // Resource override. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 33 | thunk::PPB_Flash_Functions_API* AsPPB_Flash_Functions_API() override; |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 34 | |
[email protected] | a9f2a621 | 2012-12-04 08:47:34 | [diff] [blame] | 35 | // PPB_Flash_Functions_API implementation. |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 36 | PP_Var GetProxyForURL(PP_Instance instance, const std::string& url) override; |
| 37 | void UpdateActivity(PP_Instance instance) override; |
| 38 | PP_Bool SetCrashData(PP_Instance instance, |
| 39 | PP_FlashCrashKey key, |
| 40 | PP_Var value) override; |
| 41 | double GetLocalTimeZoneOffset(PP_Instance instance, PP_Time t) override; |
| 42 | PP_Var GetSetting(PP_Instance instance, PP_FlashSetting setting) override; |
| 43 | void SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on_top) override; |
| 44 | PP_Bool DrawGlyphs( |
[email protected] | 24f40c1 | 2012-12-19 20:17:42 | [diff] [blame] | 45 | PP_Instance instance, |
| 46 | PP_Resource pp_image_data, |
| 47 | const PP_BrowserFont_Trusted_Description* font_desc, |
| 48 | uint32_t color, |
| 49 | const PP_Point* position, |
| 50 | const PP_Rect* clip, |
| 51 | const float transformation[3][3], |
| 52 | PP_Bool allow_subpixel_aa, |
| 53 | uint32_t glyph_count, |
| 54 | const uint16_t glyph_indices[], |
mostynb | 699af3c | 2014-10-06 18:03:34 | [diff] [blame] | 55 | const PP_Point glyph_advances[]) override; |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 56 | int32_t Navigate(PP_Instance instance, |
| 57 | PP_Resource request_info, |
| 58 | const char* target, |
| 59 | PP_Bool from_user_action) override; |
| 60 | PP_Bool IsRectTopmost(PP_Instance instance, const PP_Rect* rect) override; |
| 61 | void InvokePrinting(PP_Instance instance) override; |
[email protected] | c9246538 | 2012-12-17 23:51:21 | [diff] [blame] | 62 | |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 63 | private: |
[email protected] | db16e6d | 2012-12-19 03:32:57 | [diff] [blame] | 64 | // Non-owning pointer to the PluginDispatcher that owns this object. |
| 65 | PluginDispatcher* plugin_dispatcher_; |
| 66 | |
[email protected] | 11d0c36 | 2012-10-11 02:02:11 | [diff] [blame] | 67 | DISALLOW_COPY_AND_ASSIGN(FlashResource); |
| 68 | }; |
| 69 | |
| 70 | } // namespace proxy |
| 71 | } // namespace ppapi |
| 72 | |
| 73 | #endif // PPAPI_PROXY_FLASH_RESOURCE_H_ |