OLD | NEW |
1 // Copyright (c) 2010 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 CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
6 #define CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
14 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
15 #include "base/weak_ptr.h" | 15 #include "base/weak_ptr.h" |
16 #include "ppapi/c/pp_errors.h" | 16 #include "ppapi/c/pp_errors.h" |
17 #include "webkit/plugins/ppapi/plugin_delegate.h" | 17 #include "webkit/plugins/ppapi/plugin_delegate.h" |
18 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 18 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 19 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
19 | 20 |
20 class FilePath; | 21 class FilePath; |
21 class RenderView; | 22 class RenderView; |
22 | 23 |
23 namespace gfx { | 24 namespace gfx { |
| 25 class Point; |
24 class Rect; | 26 class Rect; |
25 } | 27 } |
26 | 28 |
27 namespace webkit { | 29 namespace webkit { |
28 namespace ppapi { | 30 namespace ppapi { |
29 | 31 |
30 class PluginInstance; | 32 class PluginInstance; |
31 class PluginModule; | 33 class PluginModule; |
32 | 34 |
33 } // namespace ppapi | 35 } // namespace ppapi |
34 } // namespace webkit | 36 } // namespace webkit |
35 | 37 |
36 namespace WebKit { | 38 namespace WebKit { |
37 class WebFileChooserCompletion; | 39 class WebFileChooserCompletion; |
38 struct WebFileChooserParams; | 40 struct WebFileChooserParams; |
39 } | 41 } |
40 | 42 |
| 43 namespace webkit_glue { |
| 44 struct CustomContextMenuContext; |
| 45 } |
| 46 |
41 class TransportDIB; | 47 class TransportDIB; |
42 | 48 |
43 class PepperPluginDelegateImpl | 49 class PepperPluginDelegateImpl |
44 : public webkit::ppapi::PluginDelegate, | 50 : public webkit::ppapi::PluginDelegate, |
45 public base::SupportsWeakPtr<PepperPluginDelegateImpl> { | 51 public base::SupportsWeakPtr<PepperPluginDelegateImpl> { |
46 public: | 52 public: |
47 explicit PepperPluginDelegateImpl(RenderView* render_view); | 53 explicit PepperPluginDelegateImpl(RenderView* render_view); |
48 virtual ~PepperPluginDelegateImpl(); | 54 virtual ~PepperPluginDelegateImpl(); |
49 | 55 |
50 scoped_refptr<webkit::ppapi::PluginModule> CreatePepperPlugin( | 56 scoped_refptr<webkit::ppapi::PluginModule> CreatePepperPlugin( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 uint16_t port); | 153 uint16_t port); |
148 virtual int32_t ConnectTcpAddress( | 154 virtual int32_t ConnectTcpAddress( |
149 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 155 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
150 const struct PP_Flash_NetAddress* addr); | 156 const struct PP_Flash_NetAddress* addr); |
151 // This is the completion for both |ConnectTcp()| and |ConnectTcpAddress()|. | 157 // This is the completion for both |ConnectTcp()| and |ConnectTcpAddress()|. |
152 void OnConnectTcpACK( | 158 void OnConnectTcpACK( |
153 int request_id, | 159 int request_id, |
154 base::PlatformFile socket, | 160 base::PlatformFile socket, |
155 const PP_Flash_NetAddress& local_addr, | 161 const PP_Flash_NetAddress& local_addr, |
156 const PP_Flash_NetAddress& remote_addr); | 162 const PP_Flash_NetAddress& remote_addr); |
| 163 virtual int32_t ShowContextMenu( |
| 164 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| 165 const gfx::Point& position); |
| 166 void OnContextMenuClosed( |
| 167 const webkit_glue::CustomContextMenuContext& custom_context); |
| 168 void OnCustomContextMenuAction( |
| 169 const webkit_glue::CustomContextMenuContext& custom_context, |
| 170 unsigned action); |
| 171 void CompleteShowContextMenu(int request_id, |
| 172 bool did_select, |
| 173 unsigned action); |
157 virtual webkit::ppapi::FullscreenContainer* | 174 virtual webkit::ppapi::FullscreenContainer* |
158 CreateFullscreenContainer( | 175 CreateFullscreenContainer( |
159 webkit::ppapi::PluginInstance* instance); | 176 webkit::ppapi::PluginInstance* instance); |
160 virtual std::string GetDefaultEncoding(); | 177 virtual std::string GetDefaultEncoding(); |
161 virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor); | 178 virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor); |
162 virtual std::string ResolveProxy(const GURL& url); | 179 virtual std::string ResolveProxy(const GURL& url); |
163 virtual void DidStartLoading(); | 180 virtual void DidStartLoading(); |
164 virtual void DidStopLoading(); | 181 virtual void DidStopLoading(); |
165 virtual void SetContentRestriction(int restrictions); | 182 virtual void SetContentRestriction(int restrictions); |
166 virtual void HasUnsupportedFeature(); | 183 virtual void HasUnsupportedFeature(); |
167 | 184 |
168 private: | 185 private: |
169 // Pointer to the RenderView that owns us. | 186 // Pointer to the RenderView that owns us. |
170 RenderView* render_view_; | 187 RenderView* render_view_; |
171 | 188 |
172 std::set<webkit::ppapi::PluginInstance*> active_instances_; | 189 std::set<webkit::ppapi::PluginInstance*> active_instances_; |
173 | 190 |
| 191 // Used to send a single context menu "completion" upon menu close. |
| 192 bool has_saved_context_menu_action_; |
| 193 unsigned saved_context_menu_action_; |
| 194 |
174 // TODO(viettrungluu): Get rid of |id_generator_| -- just use |IDMap::Add()|. | 195 // TODO(viettrungluu): Get rid of |id_generator_| -- just use |IDMap::Add()|. |
175 // Rename |messages_waiting_replies_| (to specify async open file). | 196 // Rename |messages_waiting_replies_| (to specify async open file). |
176 int id_generator_; | 197 int id_generator_; |
177 IDMap<AsyncOpenFileCallback> messages_waiting_replies_; | 198 IDMap<AsyncOpenFileCallback> messages_waiting_replies_; |
178 | 199 |
179 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, | 200 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, |
180 IDMapOwnPointer> pending_connect_tcps_; | 201 IDMapOwnPointer> pending_connect_tcps_; |
181 | 202 |
| 203 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
| 204 IDMapOwnPointer> pending_context_menus_; |
| 205 |
182 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 206 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
183 }; | 207 }; |
184 | 208 |
185 #endif // CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 209 #endif // CHROME_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |