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