OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/renderer/pepper/pepper_flash_menu_host.h" | 5 #include "chrome/renderer/pepper/pepper_flash_menu_host.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/public/common/context_menu_params.h" | 8 #include "content/public/common/context_menu_params.h" |
9 #include "content/public/renderer/render_frame.h" | 9 #include "content/public/renderer/render_frame.h" |
10 #include "content/public/renderer/renderer_ppapi_host.h" | 10 #include "content/public/renderer/renderer_ppapi_host.h" |
11 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
12 #include "ppapi/c/private/ppb_flash_menu.h" | 12 #include "ppapi/c/private/ppb_flash_menu.h" |
13 #include "ppapi/host/dispatch_host_message.h" | 13 #include "ppapi/host/dispatch_host_message.h" |
14 #include "ppapi/host/ppapi_host.h" | 14 #include "ppapi/host/ppapi_host.h" |
15 #include "ppapi/proxy/ppapi_messages.h" | 15 #include "ppapi/proxy/ppapi_messages.h" |
16 #include "ppapi/proxy/serialized_flash_menu.h" | 16 #include "ppapi/proxy/serialized_flash_menu.h" |
17 #include "ui/gfx/point.h" | 17 #include "ui/gfx/geometry/point.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Maximum depth of submenus allowed (e.g., 1 indicates that submenus are | 21 // Maximum depth of submenus allowed (e.g., 1 indicates that submenus are |
22 // allowed, but not sub-submenus). | 22 // allowed, but not sub-submenus). |
23 const size_t kMaxMenuDepth = 2; | 23 const size_t kMaxMenuDepth = 2; |
24 | 24 |
25 // Maximum number of entries in any single menu (including separators). | 25 // Maximum number of entries in any single menu (including separators). |
26 const size_t kMaxMenuEntries = 50; | 26 const size_t kMaxMenuEntries = 50; |
27 | 27 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 193 } |
194 | 194 |
195 void PepperFlashMenuHost::SendMenuReply(int32_t result, int action) { | 195 void PepperFlashMenuHost::SendMenuReply(int32_t result, int action) { |
196 ppapi::host::ReplyMessageContext reply_context( | 196 ppapi::host::ReplyMessageContext reply_context( |
197 ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0), | 197 ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0), |
198 NULL, | 198 NULL, |
199 MSG_ROUTING_NONE); | 199 MSG_ROUTING_NONE); |
200 reply_context.params.set_result(result); | 200 reply_context.params.set_result(result); |
201 host()->SendReply(reply_context, PpapiPluginMsg_FlashMenu_ShowReply(action)); | 201 host()->SendReply(reply_context, PpapiPluginMsg_FlashMenu_ShowReply(action)); |
202 } | 202 } |
OLD | NEW |