Chromium Code Reviews| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 } | 57 } |
| 58 | 58 |
| 59 namespace ppapi { | 59 namespace ppapi { |
| 60 struct PPP_Instance_Combined; | 60 struct PPP_Instance_Combined; |
| 61 class Resource; | 61 class Resource; |
| 62 } | 62 } |
| 63 | 63 |
| 64 namespace webkit { | 64 namespace webkit { |
| 65 namespace ppapi { | 65 namespace ppapi { |
| 66 | 66 |
| 67 class FullscreenContainer; | |
| 68 class MessageChannel; | 67 class MessageChannel; |
| 69 class ObjectVar; | 68 class ObjectVar; |
| 70 class PluginDelegate; | 69 class PluginDelegate; |
| 71 class PluginModule; | 70 class PluginModule; |
| 72 class PluginObject; | 71 class PluginObject; |
| 73 class PPB_Graphics2D_Impl; | 72 class PPB_Graphics2D_Impl; |
| 74 class PPB_Graphics3D_Impl; | 73 class PPB_Graphics3D_Impl; |
| 75 class PPB_ImageData_Impl; | 74 class PPB_ImageData_Impl; |
| 76 class PPB_Surface3D_Impl; | 75 class PPB_Surface3D_Impl; |
| 77 class PPB_URLLoader_Impl; | 76 class PPB_URLLoader_Impl; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 bool SupportsPrintInterface(); | 202 bool SupportsPrintInterface(); |
| 204 int PrintBegin(const gfx::Rect& printable_area, int printer_dpi); | 203 int PrintBegin(const gfx::Rect& printable_area, int printer_dpi); |
| 205 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); | 204 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); |
| 206 void PrintEnd(); | 205 void PrintEnd(); |
| 207 | 206 |
| 208 void Graphics3DContextLost(); | 207 void Graphics3DContextLost(); |
| 209 | 208 |
| 210 // Implementation of PPB_Fullscreen_Dev. | 209 // Implementation of PPB_Fullscreen_Dev. |
| 211 | 210 |
| 212 // Because going to fullscreen is asynchronous (but going out is not), there | 211 // Because going to fullscreen is asynchronous (but going out is not), there |
| 213 // are 3 states: | 212 // are 3 states: |
|
polina
2011/09/02 00:19:26
This comment is out of date for the new implementa
| |
| 214 // - normal (fullscreen_container_ == NULL) | 213 // - normal (fullscreen_container_ == NULL) |
| 215 // - fullscreen pending (fullscreen_container_ != NULL, fullscreen_ == false) | 214 // - fullscreen pending (fullscreen_container_ != NULL, fullscreen_ == false) |
| 216 // - fullscreen (fullscreen_container_ != NULL, fullscreen_ = true) | 215 // - fullscreen (fullscreen_container_ != NULL, fullscreen_ = true) |
| 217 // | 216 // |
| 218 // In normal state, events come from webkit and painting goes back to it. | 217 // In normal state, events come from webkit and painting goes back to it. |
| 219 // In fullscreen state, events come from the fullscreen container, and | 218 // In fullscreen state, events come from the fullscreen container, and |
| 220 // painting goes back to it | 219 // painting goes back to it |
| 221 // In pending state, events from webkit are ignored, and as soon as we receive | 220 // In pending state, events from webkit are ignored, and as soon as we receive |
| 222 // events from the fullscreen container, we go to the fullscreen state. | 221 // events from the fullscreen container, we go to the fullscreen state. |
| 223 bool IsFullscreenOrPending(); | 222 bool IsFullscreenOrPending(); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 235 | 234 |
| 236 // Implementation of PPP_Messaging. | 235 // Implementation of PPP_Messaging. |
| 237 void HandleMessage(PP_Var message); | 236 void HandleMessage(PP_Var message); |
| 238 | 237 |
| 239 PluginDelegate::PlatformContext3D* CreateContext3D(); | 238 PluginDelegate::PlatformContext3D* CreateContext3D(); |
| 240 | 239 |
| 241 // Returns true iff the plugin is a full-page plugin (i.e. not in an iframe or | 240 // Returns true iff the plugin is a full-page plugin (i.e. not in an iframe or |
| 242 // embedded in a page). | 241 // embedded in a page). |
| 243 bool IsFullPagePlugin() const; | 242 bool IsFullPagePlugin() const; |
| 244 | 243 |
| 245 FullscreenContainer* fullscreen_container() const { | |
| 246 return fullscreen_container_; | |
| 247 } | |
| 248 | |
| 249 // FunctionGroupBase overrides. | 244 // FunctionGroupBase overrides. |
| 250 virtual ::ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() | 245 virtual ::ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() |
| 251 OVERRIDE; | 246 OVERRIDE; |
| 252 | 247 |
| 253 // PPB_Instance_API implementation. | 248 // PPB_Instance_API implementation. |
| 254 virtual PP_Bool BindGraphics(PP_Instance instance, | 249 virtual PP_Bool BindGraphics(PP_Instance instance, |
| 255 PP_Resource device) OVERRIDE; | 250 PP_Resource device) OVERRIDE; |
| 256 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; | 251 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; |
| 257 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; | 252 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; |
| 258 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; | 253 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 // The plugin 3D interface. | 455 // The plugin 3D interface. |
| 461 const PPP_Graphics3D_Dev* plugin_graphics_3d_interface_; | 456 const PPP_Graphics3D_Dev* plugin_graphics_3d_interface_; |
| 462 | 457 |
| 463 // Contains the cursor if it's set by the plugin. | 458 // Contains the cursor if it's set by the plugin. |
| 464 scoped_ptr<WebKit::WebCursorInfo> cursor_; | 459 scoped_ptr<WebKit::WebCursorInfo> cursor_; |
| 465 | 460 |
| 466 // Set to true if this plugin thinks it will always be on top. This allows us | 461 // Set to true if this plugin thinks it will always be on top. This allows us |
| 467 // to use a more optimized painting path in some cases. | 462 // to use a more optimized painting path in some cases. |
| 468 bool always_on_top_; | 463 bool always_on_top_; |
| 469 | 464 |
| 470 // Plugin container for fullscreen mode. NULL if not in fullscreen mode. Note: | 465 // Since entering fullscreen mode is an asynchronous operation, we set this |
| 471 // there is a transition state where fullscreen_container_ is non-NULL but | 466 // variable to the desired state at the time we issue the fullscreen change |
| 472 // fullscreen_ is false (see above). | 467 // request. The plugin will receive a DidChangeView event when it goes |
| 473 FullscreenContainer* fullscreen_container_; | 468 // fullscreen. |
| 469 bool desired_fullscreen_state_; | |
| 474 | 470 |
| 475 // True if we are in fullscreen mode. Note: it is false during the transition. | 471 // True if we are in fullscreen mode. Note: it is false during the transition. |
| 476 bool fullscreen_; | 472 bool fullscreen_; |
| 477 | 473 |
| 478 // The MessageChannel used to implement bidirectional postMessage for the | 474 // The MessageChannel used to implement bidirectional postMessage for the |
| 479 // instance. | 475 // instance. |
| 480 scoped_ptr<MessageChannel> message_channel_; | 476 scoped_ptr<MessageChannel> message_channel_; |
| 481 | 477 |
| 482 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. | 478 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. |
| 483 SkBitmap* sad_plugin_; | 479 SkBitmap* sad_plugin_; |
| 484 | 480 |
| 485 typedef std::set<PluginObject*> PluginObjectSet; | 481 typedef std::set<PluginObject*> PluginObjectSet; |
| 486 PluginObjectSet live_plugin_objects_; | 482 PluginObjectSet live_plugin_objects_; |
| 487 | 483 |
| 488 // Classes of events that the plugin has registered for, both for filtering | 484 // Classes of events that the plugin has registered for, both for filtering |
| 489 // and not. The bits are PP_INPUTEVENT_CLASS_*. | 485 // and not. The bits are PP_INPUTEVENT_CLASS_*. |
| 490 uint32_t input_event_mask_; | 486 uint32_t input_event_mask_; |
| 491 uint32_t filtered_input_event_mask_; | 487 uint32_t filtered_input_event_mask_; |
| 492 | 488 |
| 493 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 489 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 494 }; | 490 }; |
| 495 | 491 |
| 496 } // namespace ppapi | 492 } // namespace ppapi |
| 497 } // namespace webkit | 493 } // namespace webkit |
| 498 | 494 |
| 499 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 495 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |