| 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 <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/pp_completion_callback.h" | 20 #include "ppapi/c/pp_completion_callback.h" |
| 21 #include "ppapi/c/pp_instance.h" | 21 #include "ppapi/c/pp_instance.h" |
| 22 #include "ppapi/c/pp_resource.h" | 22 #include "ppapi/c/pp_resource.h" |
| 23 #include "ppapi/c/pp_var.h" | 23 #include "ppapi/c/pp_var.h" |
| 24 #include "ppapi/c/ppb_input_event.h" | 24 #include "ppapi/c/ppb_input_event.h" |
| 25 #include "ppapi/shared_impl/function_group_base.h" | 25 #include "ppapi/shared_impl/function_group_base.h" |
| 26 #include "ppapi/shared_impl/ppb_instance_shared.h" | 26 #include "ppapi/shared_impl/ppb_instance_shared.h" |
| 27 #include "ppapi/shared_impl/ppb_view_shared.h" |
| 27 #include "ppapi/thunk/ppb_instance_api.h" | 28 #include "ppapi/thunk/ppb_instance_api.h" |
| 28 #include "third_party/skia/include/core/SkRefCnt.h" | 29 #include "third_party/skia/include/core/SkRefCnt.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 31 #include "ui/base/ime/text_input_type.h" | 32 #include "ui/base/ime/text_input_type.h" |
| 32 #include "ui/gfx/rect.h" | 33 #include "ui/gfx/rect.h" |
| 33 #include "webkit/plugins/ppapi/plugin_delegate.h" | 34 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 34 #include "webkit/plugins/webkit_plugins_export.h" | 35 #include "webkit/plugins/webkit_plugins_export.h" |
| 35 | 36 |
| 36 struct PP_Point; | 37 struct PP_Point; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // | 79 // |
| 79 // Note: to get from a PP_Instance to a PluginInstance*, use the | 80 // Note: to get from a PP_Instance to a PluginInstance*, use the |
| 80 // ResourceTracker. | 81 // ResourceTracker. |
| 81 class WEBKIT_PLUGINS_EXPORT PluginInstance : | 82 class WEBKIT_PLUGINS_EXPORT PluginInstance : |
| 82 public base::RefCounted<PluginInstance>, | 83 public base::RefCounted<PluginInstance>, |
| 83 public ::ppapi::FunctionGroupBase, | 84 public ::ppapi::FunctionGroupBase, |
| 84 NON_EXPORTED_BASE(public ::ppapi::thunk::PPB_Instance_FunctionAPI), | 85 NON_EXPORTED_BASE(public ::ppapi::thunk::PPB_Instance_FunctionAPI), |
| 85 public ::ppapi::PPB_Instance_Shared { | 86 public ::ppapi::PPB_Instance_Shared { |
| 86 public: | 87 public: |
| 87 // Create and return a PluginInstance object which supports the | 88 // Create and return a PluginInstance object which supports the |
| 88 // PPP_Instance_1_0 interface. | 89 // given version. |
| 89 static PluginInstance* Create1_0(PluginDelegate* delegate, | 90 static PluginInstance* Create1_0(PluginDelegate* delegate, |
| 90 PluginModule* module, | 91 PluginModule* module, |
| 91 const void* ppp_instance_if_1_0); | 92 const void* ppp_instance_if_1_0); |
| 93 static PluginInstance* Create1_1(PluginDelegate* delegate, |
| 94 PluginModule* module, |
| 95 const void* ppp_instance_if_1_1); |
| 92 | 96 |
| 93 // Delete should be called by the WebPlugin before this destructor. | 97 // Delete should be called by the WebPlugin before this destructor. |
| 94 virtual ~PluginInstance(); | 98 virtual ~PluginInstance(); |
| 95 | 99 |
| 96 PluginDelegate* delegate() const { return delegate_; } | 100 PluginDelegate* delegate() const { return delegate_; } |
| 97 PluginModule* module() const { return module_.get(); } | 101 PluginModule* module() const { return module_.get(); } |
| 98 MessageChannel& message_channel() { return *message_channel_; } | 102 MessageChannel& message_channel() { return *message_channel_; } |
| 99 | 103 |
| 100 WebKit::WebPluginContainer* container() const { return container_; } | 104 WebKit::WebPluginContainer* container() const { return container_; } |
| 101 | 105 |
| 102 const gfx::Rect& position() const { return position_; } | |
| 103 const gfx::Rect& clip() const { return clip_; } | |
| 104 | |
| 105 void set_always_on_top(bool on_top) { always_on_top_ = on_top; } | 106 void set_always_on_top(bool on_top) { always_on_top_ = on_top; } |
| 106 | 107 |
| 107 // Returns the PP_Instance uniquely identifying this instance. Guaranteed | 108 // Returns the PP_Instance uniquely identifying this instance. Guaranteed |
| 108 // nonzero. | 109 // nonzero. |
| 109 PP_Instance pp_instance() const { return pp_instance_; } | 110 PP_Instance pp_instance() const { return pp_instance_; } |
| 110 | 111 |
| 111 // Does some pre-destructor cleanup on the instance. This is necessary | 112 // Does some pre-destructor cleanup on the instance. This is necessary |
| 112 // because some cleanup depends on the plugin instance still existing (like | 113 // because some cleanup depends on the plugin instance still existing (like |
| 113 // calling the plugin's DidDestroy function). This function is called from | 114 // calling the plugin's DidDestroy function). This function is called from |
| 114 // the WebPlugin implementation when WebKit is about to remove the plugin. | 115 // the WebPlugin implementation when WebKit is about to remove the plugin. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 137 // Commit the backing texture to the screen once the side effects some | 138 // Commit the backing texture to the screen once the side effects some |
| 138 // rendering up to an offscreen SwapBuffers are visible. | 139 // rendering up to an offscreen SwapBuffers are visible. |
| 139 void CommitBackingTexture(); | 140 void CommitBackingTexture(); |
| 140 | 141 |
| 141 // Called when the out-of-process plugin implementing this instance crashed. | 142 // Called when the out-of-process plugin implementing this instance crashed. |
| 142 void InstanceCrashed(); | 143 void InstanceCrashed(); |
| 143 | 144 |
| 144 // PPB_Instance and PPB_Instance_Private implementation. | 145 // PPB_Instance and PPB_Instance_Private implementation. |
| 145 const GURL& plugin_url() const { return plugin_url_; } | 146 const GURL& plugin_url() const { return plugin_url_; } |
| 146 bool full_frame() const { return full_frame_; } | 147 bool full_frame() const { return full_frame_; } |
| 148 const ::ppapi::ViewData& view_data() const { return view_data_; } |
| 147 // If |type| is not PP_CURSORTYPE_CUSTOM, |custom_image| and |hot_spot| are | 149 // If |type| is not PP_CURSORTYPE_CUSTOM, |custom_image| and |hot_spot| are |
| 148 // ignored. | 150 // ignored. |
| 149 bool SetCursor(PP_CursorType_Dev type, | 151 bool SetCursor(PP_CursorType_Dev type, |
| 150 PP_Resource custom_image, | 152 PP_Resource custom_image, |
| 151 const PP_Point* hot_spot); | 153 const PP_Point* hot_spot); |
| 152 | 154 |
| 153 // PPP_Instance and PPP_Instance_Private pass-through. | 155 // PPP_Instance and PPP_Instance_Private pass-through. |
| 154 bool Initialize(WebKit::WebPluginContainer* container, | 156 bool Initialize(WebKit::WebPluginContainer* container, |
| 155 const std::vector<std::string>& arg_names, | 157 const std::vector<std::string>& arg_names, |
| 156 const std::vector<std::string>& arg_values, | 158 const std::vector<std::string>& arg_values, |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void SimulateInputEvent(const ::ppapi::InputEventData& input_event); | 301 void SimulateInputEvent(const ::ppapi::InputEventData& input_event); |
| 300 | 302 |
| 301 // FunctionGroupBase overrides. | 303 // FunctionGroupBase overrides. |
| 302 virtual ::ppapi::thunk::PPB_Instance_FunctionAPI* | 304 virtual ::ppapi::thunk::PPB_Instance_FunctionAPI* |
| 303 AsPPB_Instance_FunctionAPI() OVERRIDE; | 305 AsPPB_Instance_FunctionAPI() OVERRIDE; |
| 304 | 306 |
| 305 // PPB_Instance_FunctionAPI implementation. | 307 // PPB_Instance_FunctionAPI implementation. |
| 306 virtual PP_Bool BindGraphics(PP_Instance instance, | 308 virtual PP_Bool BindGraphics(PP_Instance instance, |
| 307 PP_Resource device) OVERRIDE; | 309 PP_Resource device) OVERRIDE; |
| 308 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; | 310 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; |
| 311 virtual const ::ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE; |
| 309 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; | 312 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; |
| 310 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; | 313 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; |
| 311 virtual PP_Var ExecuteScript(PP_Instance instance, | 314 virtual PP_Var ExecuteScript(PP_Instance instance, |
| 312 PP_Var script, | 315 PP_Var script, |
| 313 PP_Var* exception) OVERRIDE; | 316 PP_Var* exception) OVERRIDE; |
| 314 virtual PP_Var GetDefaultCharSet(PP_Instance instance) OVERRIDE; | 317 virtual PP_Var GetDefaultCharSet(PP_Instance instance) OVERRIDE; |
| 315 virtual void Log(PP_Instance instance, | 318 virtual void Log(PP_Instance instance, |
| 316 int log_level, | 319 int log_level, |
| 317 PP_Var value) OVERRIDE; | 320 PP_Var value) OVERRIDE; |
| 318 virtual void LogWithSource(PP_Instance instance, | 321 virtual void LogWithSource(PP_Instance instance, |
| 319 int log_level, | 322 int log_level, |
| 320 PP_Var source, | 323 PP_Var source, |
| 321 PP_Var value) OVERRIDE; | 324 PP_Var value) OVERRIDE; |
| 322 virtual void NumberOfFindResultsChanged(PP_Instance instance, | 325 virtual void NumberOfFindResultsChanged(PP_Instance instance, |
| 323 int32_t total, | 326 int32_t total, |
| 324 PP_Bool final_result) OVERRIDE; | 327 PP_Bool final_result) OVERRIDE; |
| 325 virtual void SelectedFindResultChanged(PP_Instance instance, | 328 virtual void SelectedFindResultChanged(PP_Instance instance, |
| 326 int32_t index) OVERRIDE; | 329 int32_t index) OVERRIDE; |
| 327 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; | 330 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; |
| 328 virtual PP_Bool FlashSetFullscreen(PP_Instance instance, | 331 virtual PP_Bool FlashSetFullscreen(PP_Instance instance, |
| 329 PP_Bool fullscreen) OVERRIDE; | 332 PP_Bool fullscreen) OVERRIDE; |
| 330 virtual PP_Bool FlashGetScreenSize(PP_Instance instance, | 333 virtual PP_Bool FlashGetScreenSize(PP_Instance instance, |
| 331 PP_Size* size) OVERRIDE; | 334 PP_Size* size) OVERRIDE; |
| 332 virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; | |
| 333 virtual PP_Bool SetFullscreen(PP_Instance instance, | 335 virtual PP_Bool SetFullscreen(PP_Instance instance, |
| 334 PP_Bool fullscreen) OVERRIDE; | 336 PP_Bool fullscreen) OVERRIDE; |
| 335 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) | 337 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) |
| 336 OVERRIDE; | 338 OVERRIDE; |
| 337 virtual int32_t RequestInputEvents(PP_Instance instance, | 339 virtual int32_t RequestInputEvents(PP_Instance instance, |
| 338 uint32_t event_classes) OVERRIDE; | 340 uint32_t event_classes) OVERRIDE; |
| 339 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, | 341 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
| 340 uint32_t event_classes) OVERRIDE; | 342 uint32_t event_classes) OVERRIDE; |
| 341 virtual void ClearInputEventRequest(PP_Instance instance, | 343 virtual void ClearInputEventRequest(PP_Instance instance, |
| 342 uint32_t event_classes) OVERRIDE; | 344 uint32_t event_classes) OVERRIDE; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 bool LoadPdfInterface(); | 379 bool LoadPdfInterface(); |
| 378 bool LoadPrintInterface(); | 380 bool LoadPrintInterface(); |
| 379 bool LoadPrivateInterface(); | 381 bool LoadPrivateInterface(); |
| 380 bool LoadSelectionInterface(); | 382 bool LoadSelectionInterface(); |
| 381 bool LoadZoomInterface(); | 383 bool LoadZoomInterface(); |
| 382 | 384 |
| 383 // Determines if we think the plugin has focus, both content area and webkit | 385 // Determines if we think the plugin has focus, both content area and webkit |
| 384 // (see has_webkit_focus_ below). | 386 // (see has_webkit_focus_ below). |
| 385 bool PluginHasFocus() const; | 387 bool PluginHasFocus() const; |
| 386 | 388 |
| 389 void ScheduleAsyncDidChangeView(const ::ppapi::ViewData& previous_view); |
| 390 void SendAsyncDidChangeView(const ::ppapi::ViewData& previous_view); |
| 391 void SendDidChangeView(const ::ppapi::ViewData& previous_view); |
| 392 |
| 387 // Reports the current plugin geometry to the plugin by calling | 393 // Reports the current plugin geometry to the plugin by calling |
| 388 // DidChangeView. | 394 // DidChangeView. |
| 389 void ReportGeometry(); | 395 void ReportGeometry(); |
| 390 | 396 |
| 391 // Queries the plugin for supported print formats and sets |format| to the | 397 // Queries the plugin for supported print formats and sets |format| to the |
| 392 // best format to use. Returns false if the plugin does not support any | 398 // best format to use. Returns false if the plugin does not support any |
| 393 // print format that we can handle (we can handle raster and PDF). | 399 // print format that we can handle (we can handle raster and PDF). |
| 394 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); | 400 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); |
| 395 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); | 401 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); |
| 396 bool PrintRasterOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); | 402 bool PrintRasterOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 int selection_end); | 443 int selection_end); |
| 438 | 444 |
| 439 // Checks if the security origin of the document containing this instance can | 445 // Checks if the security origin of the document containing this instance can |
| 440 // assess the security origin of the main frame document. | 446 // assess the security origin of the main frame document. |
| 441 bool CanAccessMainFrame() const; | 447 bool CanAccessMainFrame() const; |
| 442 | 448 |
| 443 // Returns true if the WebView the plugin is in renders via the accelerated | 449 // Returns true if the WebView the plugin is in renders via the accelerated |
| 444 // compositing path. | 450 // compositing path. |
| 445 bool IsViewAccelerated(); | 451 bool IsViewAccelerated(); |
| 446 | 452 |
| 447 // Remember view parameters that were sent to the plugin. | |
| 448 void SetSentDidChangeView(const gfx::Rect& position, const gfx::Rect& clip); | |
| 449 | |
| 450 // Track, set and reset size attributes to control the size of the plugin | 453 // Track, set and reset size attributes to control the size of the plugin |
| 451 // in and out of fullscreen mode. | 454 // in and out of fullscreen mode. |
| 452 void KeepSizeAttributesBeforeFullscreen(); | 455 void KeepSizeAttributesBeforeFullscreen(); |
| 453 void SetSizeAttributesForFullscreen(); | 456 void SetSizeAttributesForFullscreen(); |
| 454 void ResetSizeAttributesAfterFullscreen(); | 457 void ResetSizeAttributesAfterFullscreen(); |
| 455 | 458 |
| 456 PluginDelegate* delegate_; | 459 PluginDelegate* delegate_; |
| 457 scoped_refptr<PluginModule> module_; | 460 scoped_refptr<PluginModule> module_; |
| 458 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; | 461 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; |
| 459 | 462 |
| 460 PP_Instance pp_instance_; | 463 PP_Instance pp_instance_; |
| 461 | 464 |
| 462 // NULL until we have been initialized. | 465 // NULL until we have been initialized. |
| 463 WebKit::WebPluginContainer* container_; | 466 WebKit::WebPluginContainer* container_; |
| 464 | 467 |
| 465 // Plugin URL. | 468 // Plugin URL. |
| 466 GURL plugin_url_; | 469 GURL plugin_url_; |
| 467 | 470 |
| 468 // Indicates whether this is a full frame instance, which means it represents | 471 // Indicates whether this is a full frame instance, which means it represents |
| 469 // an entire document rather than an embed tag. | 472 // an entire document rather than an embed tag. |
| 470 bool full_frame_; | 473 bool full_frame_; |
| 471 | 474 |
| 475 // Stores the current state of the plugin view. |
| 476 ::ppapi::ViewData view_data_; |
| 477 |
| 472 // Indicates if we've ever sent a didChangeView to the plugin. This ensure we | 478 // Indicates if we've ever sent a didChangeView to the plugin. This ensure we |
| 473 // always send an initial notification, even if the position and clip are the | 479 // always send an initial notification, even if the position and clip are the |
| 474 // same as the default values. | 480 // same as the default values. |
| 475 bool sent_did_change_view_; | 481 bool sent_initial_did_change_view_; |
| 476 | 482 |
| 477 // Position in the viewport (which moves as the page is scrolled) of this | 483 // Set to true when we've scheduled an asynchronous DidChangeView update for |
| 478 // plugin. This will be a 0-sized rectangle if the plugin has not yet been | 484 // the purposes of consolidating updates. When this is set, code should |
| 479 // laid out. | 485 // update the view_data_ but not send updates. It will be cleared once the |
| 480 gfx::Rect position_; | 486 // asynchronous update has been sent out. |
| 481 | 487 bool suppress_did_change_view_; |
| 482 // Current clip rect. This will be empty if the plugin is not currently | |
| 483 // visible. This is in the plugin's coordinate system, so fully visible will | |
| 484 // be (0, 0, w, h) regardless of scroll position. | |
| 485 gfx::Rect clip_; | |
| 486 | 488 |
| 487 // The current device context for painting in 2D or 3D. | 489 // The current device context for painting in 2D or 3D. |
| 488 scoped_refptr< ::ppapi::Resource> bound_graphics_; | 490 scoped_refptr< ::ppapi::Resource> bound_graphics_; |
| 489 | 491 |
| 490 // We track two types of focus, one from WebKit, which is the focus among | 492 // We track two types of focus, one from WebKit, which is the focus among |
| 491 // all elements of the page, one one from the browser, which is whether the | 493 // all elements of the page, one one from the browser, which is whether the |
| 492 // tab/window has focus. We tell the plugin it has focus only when both of | 494 // tab/window has focus. We tell the plugin it has focus only when both of |
| 493 // these values are set to true. | 495 // these values are set to true. |
| 494 bool has_webkit_focus_; | 496 bool has_webkit_focus_; |
| 495 bool has_content_area_focus_; | 497 bool has_content_area_focus_; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 // to use a more optimized painting path in some cases. | 551 // to use a more optimized painting path in some cases. |
| 550 bool always_on_top_; | 552 bool always_on_top_; |
| 551 | 553 |
| 552 // Implementation of PPB_FlashFullscreen. | 554 // Implementation of PPB_FlashFullscreen. |
| 553 | 555 |
| 554 // Plugin container for fullscreen mode. NULL if not in fullscreen mode. Note: | 556 // Plugin container for fullscreen mode. NULL if not in fullscreen mode. Note: |
| 555 // there is a transition state where fullscreen_container_ is non-NULL but | 557 // there is a transition state where fullscreen_container_ is non-NULL but |
| 556 // flash_fullscreen_ is false (see above). | 558 // flash_fullscreen_ is false (see above). |
| 557 FullscreenContainer* fullscreen_container_; | 559 FullscreenContainer* fullscreen_container_; |
| 558 | 560 |
| 559 // True if we are in fullscreen mode. False if we are in normal mode or | 561 // True if we are in "flash" fullscreen mode. False if we are in normal mode |
| 560 // in transition to fullscreen. | 562 // or in transition to fullscreen. Normal fullscreen mode is indicated in |
| 563 // the ViewData. |
| 561 bool flash_fullscreen_; | 564 bool flash_fullscreen_; |
| 562 | 565 |
| 563 // Implementation of PPB_Fullscreen. | 566 // Implementation of PPB_Fullscreen. |
| 564 | 567 |
| 565 // Since entering fullscreen mode is an asynchronous operation, we set this | 568 // Since entering fullscreen mode is an asynchronous operation, we set this |
| 566 // variable to the desired state at the time we issue the fullscreen change | 569 // variable to the desired state at the time we issue the fullscreen change |
| 567 // request. The plugin will receive a DidChangeView event when it goes | 570 // request. The plugin will receive a DidChangeView event when it goes |
| 568 // fullscreen. | 571 // fullscreen. |
| 569 bool desired_fullscreen_state_; | 572 bool desired_fullscreen_state_; |
| 570 | 573 |
| 571 // True if we are in fullscreen mode. False if we are in normal mode. | |
| 572 // It reflects the previous state when in transition. | |
| 573 bool fullscreen_; | |
| 574 | |
| 575 // WebKit does not resize the plugin when going into fullscreen mode, so we do | 574 // WebKit does not resize the plugin when going into fullscreen mode, so we do |
| 576 // this here by modifying the various plugin attributes and then restoring | 575 // this here by modifying the various plugin attributes and then restoring |
| 577 // them on exit. | 576 // them on exit. |
| 578 WebKit::WebString width_before_fullscreen_; | 577 WebKit::WebString width_before_fullscreen_; |
| 579 WebKit::WebString height_before_fullscreen_; | 578 WebKit::WebString height_before_fullscreen_; |
| 580 WebKit::WebString border_before_fullscreen_; | 579 WebKit::WebString border_before_fullscreen_; |
| 581 WebKit::WebString style_before_fullscreen_; | 580 WebKit::WebString style_before_fullscreen_; |
| 582 gfx::Size screen_size_for_fullscreen_; | 581 gfx::Size screen_size_for_fullscreen_; |
| 583 | 582 |
| 584 // The MessageChannel used to implement bidirectional postMessage for the | 583 // The MessageChannel used to implement bidirectional postMessage for the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 604 | 603 |
| 605 PP_CompletionCallback lock_mouse_callback_; | 604 PP_CompletionCallback lock_mouse_callback_; |
| 606 | 605 |
| 607 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 606 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 608 }; | 607 }; |
| 609 | 608 |
| 610 } // namespace ppapi | 609 } // namespace ppapi |
| 611 } // namespace webkit | 610 } // namespace webkit |
| 612 | 611 |
| 613 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 612 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |