OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef PPAPI_PROXY_PPB_TESTING_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_TESTING_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_TESTING_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_TESTING_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "ppapi/c/pp_input_event.h" |
9 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 #include "ppapi/c/ppb_input_event.h" |
11 #include "ppapi/proxy/interface_proxy.h" | 13 #include "ppapi/proxy/interface_proxy.h" |
12 #include "ppapi/shared_impl/host_resource.h" | 14 #include "ppapi/shared_impl/host_resource.h" |
13 | 15 |
14 struct PP_Point; | 16 struct PP_Point; |
15 struct PPB_Testing_Dev; | 17 struct PPB_Testing_Dev; |
16 | 18 |
17 namespace ppapi { | 19 namespace ppapi { |
18 namespace proxy { | 20 namespace proxy { |
19 | 21 |
20 class PPB_Testing_Proxy : public InterfaceProxy { | 22 class PPB_Testing_Proxy : public InterfaceProxy { |
21 public: | 23 public: |
22 PPB_Testing_Proxy(Dispatcher* dispatcher); | 24 PPB_Testing_Proxy(Dispatcher* dispatcher); |
23 virtual ~PPB_Testing_Proxy(); | 25 virtual ~PPB_Testing_Proxy(); |
24 | 26 |
25 static const Info* GetInfo(); | 27 static const Info* GetInfo(); |
26 | 28 |
27 // InterfaceProxy implementation. | 29 // InterfaceProxy implementation. |
28 virtual bool OnMessageReceived(const IPC::Message& msg); | 30 virtual bool OnMessageReceived(const IPC::Message& msg); |
29 | 31 |
30 private: | 32 private: |
31 // Message handlers. | 33 // Message handlers. |
32 void OnMsgReadImageData(const ppapi::HostResource& device_context_2d, | 34 void OnMsgReadImageData(const ppapi::HostResource& device_context_2d, |
33 const ppapi::HostResource& image, | 35 const ppapi::HostResource& image, |
34 const PP_Point& top_left, | 36 const PP_Point& top_left, |
35 PP_Bool* result); | 37 PP_Bool* result); |
36 void OnMsgRunMessageLoop(PP_Instance instance); | 38 void OnMsgRunMessageLoop(PP_Instance instance); |
37 void OnMsgQuitMessageLoop(PP_Instance instance); | 39 void OnMsgQuitMessageLoop(PP_Instance instance); |
38 void OnMsgGetLiveObjectsForInstance(PP_Instance instance, uint32_t* result); | 40 void OnMsgGetLiveObjectsForInstance(PP_Instance instance, uint32_t* result); |
| 41 void OnMsgGenerateKeyEvent( |
| 42 PP_Instance instance, |
| 43 PP_InputEvent_Type type, |
| 44 const PP_InputEvent_Key& key_event); |
| 45 void OnMsgGenerateCharacterEvent( |
| 46 PP_Instance instance, |
| 47 const PP_InputEvent_Modifier modifier, |
| 48 const std::string& text); |
| 49 void OnMsgGenerateMouseEvent( |
| 50 PP_Instance instance, |
| 51 PP_InputEvent_Type type, |
| 52 const PP_InputEvent_Mouse& mouse_event); |
| 53 void OnMsgGenerateWheelEvent( |
| 54 PP_Instance instance, |
| 55 const PP_InputEvent_Wheel& wheel_event); |
39 | 56 |
40 // When this proxy is in the host side, this value caches the interface | 57 // When this proxy is in the host side, this value caches the interface |
41 // pointer so we don't have to retrieve it from the dispatcher each time. | 58 // pointer so we don't have to retrieve it from the dispatcher each time. |
42 // In the plugin, this value is always NULL. | 59 // In the plugin, this value is always NULL. |
43 const PPB_Testing_Dev* ppb_testing_impl_; | 60 const PPB_Testing_Dev* ppb_testing_impl_; |
44 | 61 |
45 DISALLOW_COPY_AND_ASSIGN(PPB_Testing_Proxy); | 62 DISALLOW_COPY_AND_ASSIGN(PPB_Testing_Proxy); |
46 }; | 63 }; |
47 | 64 |
48 } // namespace proxy | 65 } // namespace proxy |
49 } // namespace ppapi | 66 } // namespace ppapi |
50 | 67 |
51 #endif // PPAPI_PROXY_PPB_TESTING_PROXY_H_ | 68 #endif // PPAPI_PROXY_PPB_TESTING_PROXY_H_ |
OLD | NEW |