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_PPB_FLASH_MENU_PROXY_H_ | 5 #ifndef PPAPI_PPB_FLASH_MENU_PROXY_H_ |
6 #define PPAPI_PPB_FLASH_MENU_PROXY_H_ | 6 #define PPAPI_PPB_FLASH_MENU_PROXY_H_ |
7 | 7 |
8 #include "ppapi/proxy/interface_proxy.h" | 8 #include "ppapi/proxy/interface_proxy.h" |
9 #include "ppapi/proxy/plugin_resource.h" | 9 #include "ppapi/proxy/plugin_resource.h" |
10 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | 10 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
11 | 11 |
12 struct PP_Flash_Menu; | 12 struct PP_Flash_Menu; |
13 struct PP_Point; | 13 struct PP_Point; |
14 struct PPB_Flash_Menu; | 14 struct PPB_Flash_Menu; |
15 | 15 |
16 namespace pp { | 16 namespace pp { |
17 namespace proxy { | 17 namespace proxy { |
18 | 18 |
19 class SerializedFlashMenu; | 19 class SerializedFlashMenu; |
20 | 20 |
21 class PPB_Flash_Menu_Proxy : public InterfaceProxy { | 21 class PPB_Flash_Menu_Proxy : public InterfaceProxy { |
22 public: | 22 public: |
23 PPB_Flash_Menu_Proxy(Dispatcher* dispatcher, const void* target_interface); | 23 PPB_Flash_Menu_Proxy(Dispatcher* dispatcher, const void* target_interface); |
24 virtual ~PPB_Flash_Menu_Proxy(); | 24 virtual ~PPB_Flash_Menu_Proxy(); |
25 | 25 |
26 static const Info* GetInfo(); | 26 static const Info* GetInfo(); |
27 | 27 |
28 const PPB_Flash_Menu* ppb_flash_menu_target() const { | 28 static PP_Resource CreateProxyResource(PP_Instance instance_id, |
29 return static_cast<const PPB_Flash_Menu*>(target_interface()); | 29 const PP_Flash_Menu* menu_data); |
30 } | |
31 | 30 |
32 // InterfaceProxy implementation. | 31 // InterfaceProxy implementation. |
33 virtual bool OnMessageReceived(const IPC::Message& msg); | 32 virtual bool OnMessageReceived(const IPC::Message& msg); |
34 | 33 |
35 private: | 34 private: |
36 struct ShowRequest; | 35 struct ShowRequest; |
37 | 36 |
38 void OnMsgCreate(PP_Instance instance_id, | 37 void OnMsgCreate(PP_Instance instance_id, |
39 const SerializedFlashMenu& menu_data, | 38 const SerializedFlashMenu& menu_data, |
40 HostResource* resource); | 39 HostResource* resource); |
41 void OnMsgShow(const HostResource& menu, | 40 void OnMsgShow(const HostResource& menu, |
42 const PP_Point& location); | 41 const PP_Point& location); |
43 void OnMsgShowACK(const HostResource& menu, | 42 void OnMsgShowACK(const HostResource& menu, |
44 int32_t selected_id, | 43 int32_t selected_id, |
45 int32_t result); | 44 int32_t result); |
46 void SendShowACKToPlugin(int32_t result, ShowRequest* request); | 45 void SendShowACKToPlugin(int32_t result, ShowRequest* request); |
47 | 46 |
48 CompletionCallbackFactory<PPB_Flash_Menu_Proxy, | 47 CompletionCallbackFactory<PPB_Flash_Menu_Proxy, |
49 ProxyNonThreadSafeRefCount> callback_factory_; | 48 ProxyNonThreadSafeRefCount> callback_factory_; |
50 }; | 49 }; |
51 | 50 |
52 } // namespace proxy | 51 } // namespace proxy |
53 } // namespace pp | 52 } // namespace pp |
54 | 53 |
55 #endif // PPAPI_PPB_FLASH_MENU_PROXY_H_ | 54 #endif // PPAPI_PPB_FLASH_MENU_PROXY_H_ |
OLD | NEW |