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 WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class TransportDIB; | 51 class TransportDIB; |
52 | 52 |
53 namespace WebKit { | 53 namespace WebKit { |
54 class WebInputEvent; | 54 class WebInputEvent; |
55 class WebPluginContainer; | 55 class WebPluginContainer; |
56 struct WebCompositionUnderline; | 56 struct WebCompositionUnderline; |
57 struct WebCursorInfo; | 57 struct WebCursorInfo; |
58 } | 58 } |
59 | 59 |
60 namespace ppapi { | 60 namespace ppapi { |
| 61 struct InputEventData; |
61 struct PPP_Instance_Combined; | 62 struct PPP_Instance_Combined; |
62 class Resource; | 63 class Resource; |
63 } | 64 } |
64 | 65 |
65 namespace webkit { | 66 namespace webkit { |
66 namespace ppapi { | 67 namespace ppapi { |
67 | 68 |
68 class FullscreenContainer; | 69 class FullscreenContainer; |
69 class MessageChannel; | 70 class MessageChannel; |
70 class ObjectVar; | 71 class ObjectVar; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // - normal : fullscreen_container_ == NULL | 239 // - normal : fullscreen_container_ == NULL |
239 // flash_fullscreen_ == false | 240 // flash_fullscreen_ == false |
240 // - fullscreen pending: fullscreen_container_ != NULL | 241 // - fullscreen pending: fullscreen_container_ != NULL |
241 // flash_fullscreen_ == false | 242 // flash_fullscreen_ == false |
242 // - fullscreen : fullscreen_container_ != NULL | 243 // - fullscreen : fullscreen_container_ != NULL |
243 // flash_fullscreen_ == true | 244 // flash_fullscreen_ == true |
244 // | 245 // |
245 // In normal state, events come from webkit and painting goes back to it. | 246 // In normal state, events come from webkit and painting goes back to it. |
246 // In fullscreen state, events come from the fullscreen container, and | 247 // In fullscreen state, events come from the fullscreen container, and |
247 // painting goes back to it. | 248 // painting goes back to it. |
248 // In pending state, events from webkit are ignored, and as soon as we receive | 249 // In pending state, events from webkit are ignored, and as soon as we |
249 // events from the fullscreen container, we go to the fullscreen state. | 250 // receive events from the fullscreen container, we go to the fullscreen |
| 251 // state. |
250 bool FlashIsFullscreenOrPending(); | 252 bool FlashIsFullscreenOrPending(); |
251 | 253 |
252 // Switches between fullscreen and normal mode. If |delay_report| is set to | 254 // Switches between fullscreen and normal mode. If |delay_report| is set to |
253 // false, it may report the new state through DidChangeView immediately. If | 255 // false, it may report the new state through DidChangeView immediately. If |
254 // true, it will delay it. When called from the plugin, delay_report should be | 256 // true, it will delay it. When called from the plugin, delay_report should |
255 // true to avoid re-entrancy. | 257 // be true to avoid re-entrancy. |
256 void FlashSetFullscreen(bool fullscreen, bool delay_report); | 258 void FlashSetFullscreen(bool fullscreen, bool delay_report); |
257 | 259 |
258 FullscreenContainer* fullscreen_container() const { | 260 FullscreenContainer* fullscreen_container() const { |
259 return fullscreen_container_; | 261 return fullscreen_container_; |
260 } | 262 } |
261 | 263 |
262 // Implementation of PPB_Fullscreen. | 264 // Implementation of PPB_Fullscreen. |
263 | 265 |
264 // Because going to/from fullscreen is asynchronous, there are 4 states: | 266 // Because going to/from fullscreen is asynchronous, there are 4 states: |
265 // - normal : desired_fullscreen_state_ == false | 267 // - normal : desired_fullscreen_state_ == false |
(...skipping 16 matching lines...) Expand all Loading... |
282 // Implementation of PPB_Flash. | 284 // Implementation of PPB_Flash. |
283 int32_t Navigate(PPB_URLRequestInfo_Impl* request, | 285 int32_t Navigate(PPB_URLRequestInfo_Impl* request, |
284 const char* target, | 286 const char* target, |
285 bool from_user_action); | 287 bool from_user_action); |
286 | 288 |
287 // Implementation of PPP_Messaging. | 289 // Implementation of PPP_Messaging. |
288 void HandleMessage(PP_Var message); | 290 void HandleMessage(PP_Var message); |
289 | 291 |
290 PluginDelegate::PlatformContext3D* CreateContext3D(); | 292 PluginDelegate::PlatformContext3D* CreateContext3D(); |
291 | 293 |
292 // Returns true iff the plugin is a full-page plugin (i.e. not in an iframe or | 294 // Returns true iff the plugin is a full-page plugin (i.e. not in an iframe |
293 // embedded in a page). | 295 // or embedded in a page). |
294 bool IsFullPagePlugin() const; | 296 bool IsFullPagePlugin() const; |
295 | 297 |
296 void OnLockMouseACK(int32_t result); | 298 void OnLockMouseACK(int32_t result); |
297 void OnMouseLockLost(); | 299 void OnMouseLockLost(); |
298 | 300 |
| 301 // Simulates an input event to the plugin by passing it down to WebKit, |
| 302 // which sends it back up to the plugin as if it came from the user. |
| 303 void SimulateInputEvent(const ::ppapi::InputEventData& input_event); |
| 304 |
299 // FunctionGroupBase overrides. | 305 // FunctionGroupBase overrides. |
300 virtual ::ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() | 306 virtual ::ppapi::thunk::PPB_Instance_FunctionAPI* |
301 OVERRIDE; | 307 AsPPB_Instance_FunctionAPI() OVERRIDE; |
302 | 308 |
303 // PPB_Instance_FunctionAPI implementation. | 309 // PPB_Instance_FunctionAPI implementation. |
304 virtual PP_Bool BindGraphics(PP_Instance instance, | 310 virtual PP_Bool BindGraphics(PP_Instance instance, |
305 PP_Resource device) OVERRIDE; | 311 PP_Resource device) OVERRIDE; |
306 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; | 312 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; |
307 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; | 313 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; |
308 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; | 314 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; |
309 virtual PP_Var ExecuteScript(PP_Instance instance, | 315 virtual PP_Var ExecuteScript(PP_Instance instance, |
310 PP_Var script, | 316 PP_Var script, |
311 PP_Var* exception) OVERRIDE; | 317 PP_Var* exception) OVERRIDE; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 | 613 |
608 PP_CompletionCallback lock_mouse_callback_; | 614 PP_CompletionCallback lock_mouse_callback_; |
609 | 615 |
610 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 616 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
611 }; | 617 }; |
612 | 618 |
613 } // namespace ppapi | 619 } // namespace ppapi |
614 } // namespace webkit | 620 } // namespace webkit |
615 | 621 |
616 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 622 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
OLD | NEW |