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