| 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 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/string16.h" | 16 #include "base/string16.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 18 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
| 19 #include "ppapi/c/dev/ppp_printing_dev.h" | 19 #include "ppapi/c/dev/ppp_printing_dev.h" |
| 20 #include "ppapi/c/dev/ppp_find_dev.h" | 20 #include "ppapi/c/dev/ppp_find_dev.h" |
| 21 #include "ppapi/c/dev/ppp_selection_dev.h" | 21 #include "ppapi/c/dev/ppp_selection_dev.h" |
| 22 #include "ppapi/c/dev/ppp_zoom_dev.h" | 22 #include "ppapi/c/dev/ppp_zoom_dev.h" |
| 23 #include "ppapi/c/pp_completion_callback.h" | 23 #include "ppapi/c/pp_completion_callback.h" |
| 24 #include "ppapi/c/pp_instance.h" | 24 #include "ppapi/c/pp_instance.h" |
| 25 #include "ppapi/c/pp_resource.h" | 25 #include "ppapi/c/pp_resource.h" |
| 26 #include "ppapi/c/pp_time.h" |
| 26 #include "ppapi/c/pp_var.h" | 27 #include "ppapi/c/pp_var.h" |
| 27 #include "ppapi/c/ppb_audio_config.h" | 28 #include "ppapi/c/ppb_audio_config.h" |
| 28 #include "ppapi/c/ppb_input_event.h" | 29 #include "ppapi/c/ppb_input_event.h" |
| 29 #include "ppapi/c/ppb_gamepad.h" | 30 #include "ppapi/c/ppb_gamepad.h" |
| 30 #include "ppapi/c/ppp_graphics_3d.h" | 31 #include "ppapi/c/ppp_graphics_3d.h" |
| 31 #include "ppapi/c/ppp_input_event.h" | 32 #include "ppapi/c/ppp_input_event.h" |
| 32 #include "ppapi/c/ppp_messaging.h" | 33 #include "ppapi/c/ppp_messaging.h" |
| 33 #include "ppapi/c/ppp_mouse_lock.h" | 34 #include "ppapi/c/ppp_mouse_lock.h" |
| 34 #include "ppapi/c/private/ppp_instance_private.h" | 35 #include "ppapi/c/private/ppp_instance_private.h" |
| 35 #include "ppapi/shared_impl/function_group_base.h" | 36 #include "ppapi/shared_impl/function_group_base.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 void FlashSetFullscreen(bool fullscreen, bool delay_report); | 266 void FlashSetFullscreen(bool fullscreen, bool delay_report); |
| 266 | 267 |
| 267 FullscreenContainer* fullscreen_container() const { | 268 FullscreenContainer* fullscreen_container() const { |
| 268 return fullscreen_container_; | 269 return fullscreen_container_; |
| 269 } | 270 } |
| 270 | 271 |
| 271 // Implementation of PPB_Fullscreen. | 272 // Implementation of PPB_Fullscreen. |
| 272 | 273 |
| 273 // Because going to/from fullscreen is asynchronous, there are 4 states: | 274 // Because going to/from fullscreen is asynchronous, there are 4 states: |
| 274 // - normal : desired_fullscreen_state_ == false | 275 // - normal : desired_fullscreen_state_ == false |
| 275 // fullscreen_ == false | 276 // view_data_.is_fullscreen == false |
| 276 // - fullscreen pending: desired_fullscreen_state_ == true | 277 // - fullscreen pending: desired_fullscreen_state_ == true |
| 277 // fullscreen_ == false | 278 // view_data_.is_fullscreen == false |
| 278 // - fullscreen : desired_fullscreen_state_ == true | 279 // - fullscreen : desired_fullscreen_state_ == true |
| 279 // fullscreen_ == true | 280 // view_data_.is_fullscreen == true |
| 280 // - normal pending : desired_fullscreen_state_ = false | 281 // - normal pending : desired_fullscreen_state_ = false |
| 281 // fullscreen_ = true | 282 // view_data_.is_fullscreen = true |
| 282 bool IsFullscreenOrPending(); | 283 bool IsFullscreenOrPending(); |
| 283 | 284 |
| 284 // Switches between fullscreen and normal mode. The transition is | 285 // Switches between fullscreen and normal mode. The transition is |
| 285 // asynchronous. WebKit will trigger corresponding VewChanged calls. | 286 // asynchronous. WebKit will trigger corresponding VewChanged calls. |
| 286 // Returns true on success, false on failure (e.g. trying to enter fullscreen | 287 // Returns true on success, false on failure (e.g. trying to enter fullscreen |
| 287 // when not processing a user gesture or trying to set fullscreen when | 288 // when not processing a user gesture or trying to set fullscreen when |
| 288 // already in fullscreen mode). | 289 // already in fullscreen mode). |
| 289 bool SetFullscreen(bool fullscreen); | 290 bool SetFullscreen(bool fullscreen); |
| 290 | 291 |
| 291 // Implementation of PPB_Flash. | 292 // Implementation of PPB_Flash. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 virtual PP_Bool SetFullscreen(PP_Instance instance, | 352 virtual PP_Bool SetFullscreen(PP_Instance instance, |
| 352 PP_Bool fullscreen) OVERRIDE; | 353 PP_Bool fullscreen) OVERRIDE; |
| 353 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) | 354 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) |
| 354 OVERRIDE; | 355 OVERRIDE; |
| 355 virtual int32_t RequestInputEvents(PP_Instance instance, | 356 virtual int32_t RequestInputEvents(PP_Instance instance, |
| 356 uint32_t event_classes) OVERRIDE; | 357 uint32_t event_classes) OVERRIDE; |
| 357 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, | 358 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
| 358 uint32_t event_classes) OVERRIDE; | 359 uint32_t event_classes) OVERRIDE; |
| 359 virtual void ClearInputEventRequest(PP_Instance instance, | 360 virtual void ClearInputEventRequest(PP_Instance instance, |
| 360 uint32_t event_classes) OVERRIDE; | 361 uint32_t event_classes) OVERRIDE; |
| 362 virtual void ClosePendingUserGesture(PP_Instance instance, |
| 363 PP_TimeTicks timestamp); |
| 361 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; | 364 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; |
| 362 virtual void ZoomLimitsChanged(PP_Instance instance, | 365 virtual void ZoomLimitsChanged(PP_Instance instance, |
| 363 double minimum_factor, | 366 double minimum_factor, |
| 364 double maximium_factor) OVERRIDE; | 367 double maximium_factor) OVERRIDE; |
| 365 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; | 368 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
| 366 virtual int32_t LockMouse(PP_Instance instance, | 369 virtual int32_t LockMouse(PP_Instance instance, |
| 367 PP_CompletionCallback callback) OVERRIDE; | 370 PP_CompletionCallback callback) OVERRIDE; |
| 368 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; | 371 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; |
| 369 virtual PP_Var ResolveRelativeToDocument( | 372 virtual PP_Var ResolveRelativeToDocument( |
| 370 PP_Instance instance, | 373 PP_Instance instance, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 // Returns true if the WebView the plugin is in renders via the accelerated | 469 // Returns true if the WebView the plugin is in renders via the accelerated |
| 467 // compositing path. | 470 // compositing path. |
| 468 bool IsViewAccelerated(); | 471 bool IsViewAccelerated(); |
| 469 | 472 |
| 470 // Track, set and reset size attributes to control the size of the plugin | 473 // Track, set and reset size attributes to control the size of the plugin |
| 471 // in and out of fullscreen mode. | 474 // in and out of fullscreen mode. |
| 472 void KeepSizeAttributesBeforeFullscreen(); | 475 void KeepSizeAttributesBeforeFullscreen(); |
| 473 void SetSizeAttributesForFullscreen(); | 476 void SetSizeAttributesForFullscreen(); |
| 474 void ResetSizeAttributesAfterFullscreen(); | 477 void ResetSizeAttributesAfterFullscreen(); |
| 475 | 478 |
| 479 // Helper function to determine if an action has a user gesture. |
| 480 bool HasUserGesture(); |
| 481 |
| 476 PluginDelegate* delegate_; | 482 PluginDelegate* delegate_; |
| 477 scoped_refptr<PluginModule> module_; | 483 scoped_refptr<PluginModule> module_; |
| 478 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; | 484 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; |
| 479 | 485 |
| 480 PP_Instance pp_instance_; | 486 PP_Instance pp_instance_; |
| 481 | 487 |
| 482 // NULL until we have been initialized. | 488 // NULL until we have been initialized. |
| 483 WebKit::WebPluginContainer* container_; | 489 WebKit::WebPluginContainer* container_; |
| 484 | 490 |
| 485 // Plugin URL. | 491 // Plugin URL. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 uint32_t filtered_input_event_mask_; | 619 uint32_t filtered_input_event_mask_; |
| 614 | 620 |
| 615 // Text composition status. | 621 // Text composition status. |
| 616 ui::TextInputType text_input_type_; | 622 ui::TextInputType text_input_type_; |
| 617 gfx::Rect text_input_caret_; | 623 gfx::Rect text_input_caret_; |
| 618 gfx::Rect text_input_caret_bounds_; | 624 gfx::Rect text_input_caret_bounds_; |
| 619 bool text_input_caret_set_; | 625 bool text_input_caret_set_; |
| 620 | 626 |
| 621 PP_CompletionCallback lock_mouse_callback_; | 627 PP_CompletionCallback lock_mouse_callback_; |
| 622 | 628 |
| 629 // Track pending user gestures so out-of-process plugins can respond to |
| 630 // a user gesture after it has been processed. |
| 631 PP_TimeTicks pending_user_gesture_; |
| 632 |
| 623 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 633 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 624 }; | 634 }; |
| 625 | 635 |
| 626 } // namespace ppapi | 636 } // namespace ppapi |
| 627 } // namespace webkit | 637 } // namespace webkit |
| 628 | 638 |
| 629 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 639 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |