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 #ifndef CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ | 5 #ifndef CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ |
6 #define CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ | 6 #define CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 public content::ContextMenuClient { | 28 public content::ContextMenuClient { |
29 public: | 29 public: |
30 PepperFlashMenuHost(content::RendererPpapiHost* host, | 30 PepperFlashMenuHost(content::RendererPpapiHost* host, |
31 PP_Instance instance, | 31 PP_Instance instance, |
32 PP_Resource resource, | 32 PP_Resource resource, |
33 const ppapi::proxy::SerializedFlashMenu& serial_menu); | 33 const ppapi::proxy::SerializedFlashMenu& serial_menu); |
34 virtual ~PepperFlashMenuHost(); | 34 virtual ~PepperFlashMenuHost(); |
35 | 35 |
36 virtual int32_t OnResourceMessageReceived( | 36 virtual int32_t OnResourceMessageReceived( |
37 const IPC::Message& msg, | 37 const IPC::Message& msg, |
38 ppapi::host::HostMessageContext* context) OVERRIDE; | 38 ppapi::host::HostMessageContext* context) override; |
39 | 39 |
40 private: | 40 private: |
41 int32_t OnHostMsgShow(ppapi::host::HostMessageContext* context, | 41 int32_t OnHostMsgShow(ppapi::host::HostMessageContext* context, |
42 const PP_Point& location); | 42 const PP_Point& location); |
43 | 43 |
44 // ContextMenuClient implementation. | 44 // ContextMenuClient implementation. |
45 virtual void OnMenuAction(int request_id, unsigned action) OVERRIDE; | 45 virtual void OnMenuAction(int request_id, unsigned action) override; |
46 virtual void OnMenuClosed(int request_id) OVERRIDE; | 46 virtual void OnMenuClosed(int request_id) override; |
47 | 47 |
48 void SendMenuReply(int32_t result, int action); | 48 void SendMenuReply(int32_t result, int action); |
49 | 49 |
50 content::RendererPpapiHost* renderer_ppapi_host_; | 50 content::RendererPpapiHost* renderer_ppapi_host_; |
51 | 51 |
52 bool showing_context_menu_; | 52 bool showing_context_menu_; |
53 int context_menu_request_id_; | 53 int context_menu_request_id_; |
54 | 54 |
55 std::vector<content::MenuItem> menu_data_; | 55 std::vector<content::MenuItem> menu_data_; |
56 | 56 |
57 // We send |MenuItem|s, which have an |unsigned| "action" field instead of | 57 // We send |MenuItem|s, which have an |unsigned| "action" field instead of |
58 // an |int32_t| ID. (CONTENT also limits the range of valid values for | 58 // an |int32_t| ID. (CONTENT also limits the range of valid values for |
59 // actions.) This maps actions to IDs. | 59 // actions.) This maps actions to IDs. |
60 std::vector<int32_t> menu_id_map_; | 60 std::vector<int32_t> menu_id_map_; |
61 | 61 |
62 // Used to send a single context menu "completion" upon menu close. | 62 // Used to send a single context menu "completion" upon menu close. |
63 bool has_saved_context_menu_action_; | 63 bool has_saved_context_menu_action_; |
64 unsigned saved_context_menu_action_; | 64 unsigned saved_context_menu_action_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(PepperFlashMenuHost); | 66 DISALLOW_COPY_AND_ASSIGN(PepperFlashMenuHost); |
67 }; | 67 }; |
68 | 68 |
69 #endif // CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ | 69 #endif // CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ |
OLD | NEW |