Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / renderer / browser_plugin / browser_plugin.h
index 0c280e4..d176154 100644 (file)
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/sequenced_task_runner_helpers.h"
-#if defined(OS_WIN)
-#include "base/memory/shared_memory.h"
-#endif
 #include "base/values.h"
-#include "content/renderer/browser_plugin/browser_plugin_backing_store.h"
 #include "content/renderer/browser_plugin/browser_plugin_bindings.h"
 #include "content/renderer/mouse_lock_dispatcher.h"
 #include "content/renderer/render_view_impl.h"
@@ -46,8 +42,6 @@ class CONTENT_EXPORT BrowserPlugin :
     return browser_plugin_manager_.get();
   }
 
-  static BrowserPlugin* FromContainer(blink::WebPluginContainer* container);
-
   bool OnMessageReceived(const IPC::Message& msg);
 
   // Update Browser Plugin's DOM Node attribute |attribute_name| with the value
@@ -109,11 +103,6 @@ class CONTENT_EXPORT BrowserPlugin :
   // Returns whether this BrowserPlugin has allocated an instance ID.
   bool HasGuestInstanceID() const;
 
-  // Attaches the window identified by |window_id| to the the given node
-  // encapsulating a BrowserPlugin.
-  static bool AttachWindowTo(const blink::WebNode& node,
-                             int window_id);
-
   // Informs the guest of an updated focus state.
   void UpdateGuestFocusState();
   // Indicates whether the guest should be focused.
@@ -126,20 +115,13 @@ class CONTENT_EXPORT BrowserPlugin :
   // A request to enable hardware compositing.
   void EnableCompositing(bool enable);
 
-  // Returns true if |point| lies within the bounds of the plugin rectangle.
-  // Not OK to use this function for making security-sensitive decision since it
-  // can return false positives when the plugin has rotation transformation
-  // applied.
-  bool InBounds(const gfx::Point& point) const;
-
-  gfx::Point ToLocalCoordinates(const gfx::Point& point) const;
-
   // Called when a guest instance ID has been allocated by the browser process.
   void OnInstanceIDAllocated(int guest_instance_id);
   // Provided that a guest instance ID has been allocated, this method attaches
   // this BrowserPlugin instance to that guest. |extra_params| are parameters
   // passed in by the content embedder to the browser process.
-  void Attach(scoped_ptr<base::DictionaryValue> extra_params);
+  void Attach(int guest_instance_id,
+              scoped_ptr<base::DictionaryValue> extra_params);
 
   // Notify the plugin about a compositor commit so that frame ACKs could be
   // sent, if needed.
@@ -222,7 +204,9 @@ class CONTENT_EXPORT BrowserPlugin :
   // does an initial navigation or is attached to a newly created guest, it
   // acquires a guest_instance_id as well. The guest instance ID uniquely
   // identifies a guest WebContents that's hosted by this BrowserPlugin.
-  BrowserPlugin(RenderViewImpl* render_view, blink::WebFrame* frame);
+  BrowserPlugin(RenderViewImpl* render_view,
+                blink::WebFrame* frame,
+                bool auto_navigate);
 
   virtual ~BrowserPlugin();
 
@@ -252,15 +236,7 @@ class CONTENT_EXPORT BrowserPlugin :
   void TriggerEvent(const std::string& event_name,
                     std::map<std::string, base::Value*>* props);
 
-  // Creates and maps a shared damage buffer.
-  virtual base::SharedMemory* CreateDamageBuffer(
-      const size_t size,
-      base::SharedMemoryHandle* shared_memory_handle);
-  // Swaps out the |current_damage_buffer_| with the |pending_damage_buffer_|.
-  void SwapDamageBuffers();
-
-  // Populates BrowserPluginHostMsg_ResizeGuest_Params with resize state and
-  // allocates a new |pending_damage_buffer_| if in software rendering mode.
+  // Populates BrowserPluginHostMsg_ResizeGuest_Params with resize state.
   void PopulateResizeGuestParameters(
       BrowserPluginHostMsg_ResizeGuest_Params* params,
       const gfx::Rect& view_size,
@@ -272,7 +248,7 @@ class CONTENT_EXPORT BrowserPlugin :
 
   // Populates both AutoSize and ResizeGuest parameters based on the current
   // autosize state.
-  void GetDamageBufferWithSizeParams(
+  void GetSizeParams(
       BrowserPluginHostMsg_AutoSize_Params* auto_size_params,
       BrowserPluginHostMsg_ResizeGuest_Params* resize_guest_params,
       bool needs_repaint);
@@ -280,15 +256,6 @@ class CONTENT_EXPORT BrowserPlugin :
   // Informs the guest of an updated autosize state.
   void UpdateGuestAutoSizeState(bool auto_size_enabled);
 
-  // Indicates whether a damage buffer was used by the guest process for the
-  // provided |params|.
-  static bool UsesDamageBuffer(
-      const BrowserPluginMsg_UpdateRect_Params& params);
-
-  // Indicates whether the |pending_damage_buffer_| was used to copy over pixels
-  // given the provided |params|.
-  bool UsesPendingDamageBuffer(
-      const BrowserPluginMsg_UpdateRect_Params& params);
 
   // IPC message handlers.
   // Please keep in alphabetical order.
@@ -325,10 +292,6 @@ class CONTENT_EXPORT BrowserPlugin :
   int render_view_routing_id_;
   blink::WebPluginContainer* container_;
   scoped_ptr<BrowserPluginBindings> bindings_;
-  scoped_ptr<BrowserPluginBackingStore> backing_store_;
-  scoped_ptr<base::SharedMemory> current_damage_buffer_;
-  scoped_ptr<base::SharedMemory> pending_damage_buffer_;
-  uint32 damage_buffer_sequence_id_;
   bool paint_ack_received_;
   gfx::Rect plugin_rect_;
   float last_device_scale_factor_;
@@ -348,6 +311,9 @@ class CONTENT_EXPORT BrowserPlugin :
   // embedder RenderView's visibility.
   bool visible_;
 
+  bool auto_navigate_;
+  std::string html_string_;
+
   WebCursor cursor_;
 
   gfx::Size last_view_size_;
@@ -360,7 +326,6 @@ class CONTENT_EXPORT BrowserPlugin :
   scoped_refptr<BrowserPluginManager> browser_plugin_manager_;
 
   // Used for HW compositing.
-  bool compositing_enabled_;
   scoped_refptr<ChildFrameCompositingHelper> compositing_helper_;
 
   // Used to identify the plugin to WebBindings.