| 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 CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_H_ |
| 7 | 7 |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/sequenced_task_runner_helpers.h" | 11 #include "base/sequenced_task_runner_helpers.h" |
| 12 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" | 12 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" |
| 13 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" | 13 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" |
| 14 #include "content/renderer/render_view_impl.h" | 14 #include "content/renderer/render_view_impl.h" |
| 15 | 15 |
| 16 struct BrowserPluginMsg_UpdateRect_Params; | 16 struct BrowserPluginMsg_UpdateRect_Params; |
| 17 struct BrowserPlugin_SwapInfo; |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 namespace browser_plugin { | 20 namespace browser_plugin { |
| 20 | 21 |
| 21 class BrowserPluginManager; | 22 class BrowserPluginManager; |
| 22 | 23 |
| 23 class BrowserPlugin : public WebKit::WebPlugin { | 24 class BrowserPlugin : public WebKit::WebPlugin { |
| 24 public: | 25 public: |
| 25 void SetSrcAttribute(const std::string& src); | 26 void SetSrcAttribute(const std::string& src); |
| 26 void UpdateRect(int message_id, | 27 void UpdateRect(int message_id, |
| 27 const BrowserPluginMsg_UpdateRect_Params& params); | 28 const BrowserPluginMsg_UpdateRect_Params& params); |
| 28 void GuestCrashed(); | 29 void GuestCrashed(); |
| 29 void UpdateURL(const GURL& url); | 30 void UpdateURL(const GURL& url); |
| 30 void AdvanceFocus(bool reverse); | 31 void AdvanceFocus(bool reverse); |
| 32 void BuffersSwapped(uint64 surface_handle, const BrowserPlugin_SwapInfo& info)
; |
| 31 void PostMessage(const std::string& message, | 33 void PostMessage(const std::string& message, |
| 32 const std::string& target_origin); | 34 const std::string& target_origin); |
| 35 |
| 36 void WillInitiatePaint(); |
| 37 void PerformBuffersSwappedACK(const BrowserPlugin_SwapInfo& info); |
| 38 |
| 33 // WebKit::WebPlugin implementation. | 39 // WebKit::WebPlugin implementation. |
| 34 virtual WebKit::WebPluginContainer* container() const OVERRIDE; | 40 virtual WebKit::WebPluginContainer* container() const OVERRIDE; |
| 35 virtual bool initialize(WebKit::WebPluginContainer* container) OVERRIDE; | 41 virtual bool initialize(WebKit::WebPluginContainer* container) OVERRIDE; |
| 36 virtual void destroy() OVERRIDE; | 42 virtual void destroy() OVERRIDE; |
| 37 virtual NPObject* scriptableObject() OVERRIDE; | 43 virtual NPObject* scriptableObject() OVERRIDE; |
| 38 virtual bool supportsKeyboardFocus() const OVERRIDE; | 44 virtual bool supportsKeyboardFocus() const OVERRIDE; |
| 39 virtual void paint( | 45 virtual void paint( |
| 40 WebKit::WebCanvas* canvas, | 46 WebKit::WebCanvas* canvas, |
| 41 const WebKit::WebRect& rect) OVERRIDE; | 47 const WebKit::WebRect& rect) OVERRIDE; |
| 42 virtual void updateGeometry( | 48 virtual void updateGeometry( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 WebKit::WebPluginContainer* container_; | 92 WebKit::WebPluginContainer* container_; |
| 87 scoped_ptr<BrowserPluginBindings> bindings_; | 93 scoped_ptr<BrowserPluginBindings> bindings_; |
| 88 scoped_ptr<BrowserPluginBackingStore> backing_store_; | 94 scoped_ptr<BrowserPluginBackingStore> backing_store_; |
| 89 TransportDIB* damage_buffer_; | 95 TransportDIB* damage_buffer_; |
| 90 gfx::Rect plugin_rect_; | 96 gfx::Rect plugin_rect_; |
| 91 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. | 97 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. |
| 92 SkBitmap* sad_guest_; | 98 SkBitmap* sad_guest_; |
| 93 bool guest_crashed_; | 99 bool guest_crashed_; |
| 94 long long parent_frame_; | 100 long long parent_frame_; |
| 95 std::string src_; | 101 std::string src_; |
| 102 std::vector< base::Callback<void(void)> > compositing_callbacks_; |
| 96 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 103 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 97 }; | 104 }; |
| 98 | 105 |
| 99 } // namespace browser_plugin | 106 } // namespace browser_plugin |
| 100 } // namespace content | 107 } // namespace content |
| 101 | 108 |
| 102 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_H_ | 109 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_WEB_BROWSER_PLUGIN_H_ |
| OLD | NEW |