Chromium Code Reviews| 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_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_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 #include "ipc/ipc_forwarding_message_filter.h" | |
| 15 | 16 |
| 16 struct BrowserPluginMsg_UpdateRect_Params; | 17 struct BrowserPluginMsg_UpdateRect_Params; |
| 18 struct BrowserPlugin_SwapInfo; | |
| 19 | |
| 20 namespace gfx { | |
| 21 | |
| 22 class Size; | |
| 23 | |
| 24 } | |
|
scshunt
2012/08/12 01:42:45
Is the style to have spaces around the inner class
scshunt
2012/08/17 17:30:28
Done.
| |
| 17 | 25 |
| 18 namespace content { | 26 namespace content { |
| 19 | 27 |
| 20 class BrowserPluginManager; | 28 class BrowserPluginManager; |
| 29 class BrowserPluginTextureProvider; | |
| 21 class MockBrowserPlugin; | 30 class MockBrowserPlugin; |
| 22 | 31 |
| 23 class CONTENT_EXPORT BrowserPlugin : | 32 class CONTENT_EXPORT BrowserPlugin : |
| 24 NON_EXPORTED_BASE(public WebKit::WebPlugin) { | 33 NON_EXPORTED_BASE(public WebKit::WebPlugin) { |
| 25 public: | 34 public: |
| 26 // Called only by tests to clean up before we blow away the MockRenderProcess. | 35 // Called only by tests to clean up before we blow away the MockRenderProcess. |
| 27 void Cleanup(); | 36 void Cleanup(); |
| 28 | 37 |
| 29 // Get the src attribute value of the BrowserPlugin instance if the guest | 38 // Get the src attribute value of the BrowserPlugin instance if the guest |
| 30 // has not crashed. | 39 // has not crashed. |
| 31 std::string GetSrcAttribute() const; | 40 std::string GetSrcAttribute() const; |
| 32 // Set the src attribute value of the BrowserPlugin instance and reset | 41 // Set the src attribute value of the BrowserPlugin instance and reset |
| 33 // the guest_crashed_ flag. | 42 // the guest_crashed_ flag. |
| 34 void SetSrcAttribute(const std::string& src); | 43 void SetSrcAttribute(const std::string& src); |
| 35 | 44 |
| 36 // Inform the BrowserPlugin to update its backing store with the pixels in | 45 // Inform the BrowserPlugin to update its backing store with the pixels in |
| 37 // its damage buffer. | 46 // its damage buffer. |
| 38 void UpdateRect(int message_id, | 47 void UpdateRect(int message_id, |
| 39 const BrowserPluginMsg_UpdateRect_Params& params); | 48 const BrowserPluginMsg_UpdateRect_Params& params); |
| 40 // Inform the BrowserPlugin that its guest has crashed. | 49 // Inform the BrowserPlugin that its guest has crashed. |
| 41 void GuestCrashed(); | 50 void GuestCrashed(); |
| 42 // Informs the BrowserPlugin that the guest has navigated to a new URL. | 51 // Informs the BrowserPlugin that the guest has navigated to a new URL. |
| 43 void DidNavigate(const GURL& url); | 52 void DidNavigate(const GURL& url); |
| 44 // Tells the BrowserPlugin to advance the focus to the next (or previous) | 53 // Tells the BrowserPlugin to advance the focus to the next (or previous) |
| 45 // element. | 54 // element. |
| 46 void AdvanceFocus(bool reverse); | 55 void AdvanceFocus(bool reverse); |
| 56 void BuffersSwapped( | |
| 57 uint64 surface_handle, | |
| 58 const BrowserPlugin_SwapInfo& info); | |
| 59 void SurfaceResize(const gfx::Size& size); | |
| 60 void PostMessage(const std::string& message, | |
| 61 const std::string& target_origin); | |
| 62 | |
| 63 void TextureProviderIsReady(); | |
| 47 | 64 |
| 48 // Indicates whether there are any Javascript listeners attached to a | 65 // Indicates whether there are any Javascript listeners attached to a |
| 49 // provided event_name. | 66 // provided event_name. |
| 50 bool HasListeners(const std::string& event_name); | 67 bool HasListeners(const std::string& event_name); |
| 51 // Add a custom event listener to this BrowserPlugin instance. | 68 // Add a custom event listener to this BrowserPlugin instance. |
| 52 bool AddEventListener(const std::string& event_name, | 69 bool AddEventListener(const std::string& event_name, |
| 53 v8::Local<v8::Function> function); | 70 v8::Local<v8::Function> function); |
| 54 // Remove a custom event listener from this BrowserPlugin instance. | 71 // Remove a custom event listener from this BrowserPlugin instance. |
| 55 bool RemoveEventListener(const std::string& event_name, | 72 bool RemoveEventListener(const std::string& event_name, |
| 56 v8::Local<v8::Function> function); | 73 v8::Local<v8::Function> function); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 scoped_ptr<BrowserPluginBindings> bindings_; | 148 scoped_ptr<BrowserPluginBindings> bindings_; |
| 132 scoped_ptr<BrowserPluginBackingStore> backing_store_; | 149 scoped_ptr<BrowserPluginBackingStore> backing_store_; |
| 133 TransportDIB* damage_buffer_; | 150 TransportDIB* damage_buffer_; |
| 134 gfx::Rect plugin_rect_; | 151 gfx::Rect plugin_rect_; |
| 135 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. | 152 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. |
| 136 SkBitmap* sad_guest_; | 153 SkBitmap* sad_guest_; |
| 137 bool guest_crashed_; | 154 bool guest_crashed_; |
| 138 bool resize_pending_; | 155 bool resize_pending_; |
| 139 long long parent_frame_; | 156 long long parent_frame_; |
| 140 std::string src_; | 157 std::string src_; |
| 158 BrowserPluginTextureProvider* provider_; | |
| 159 bool ignore_input_; | |
| 141 typedef std::vector<v8::Persistent<v8::Function> > EventListeners; | 160 typedef std::vector<v8::Persistent<v8::Function> > EventListeners; |
| 142 typedef std::map<std::string, EventListeners> EventListenerMap; | 161 typedef std::map<std::string, EventListeners> EventListenerMap; |
| 143 EventListenerMap event_listener_map_; | 162 EventListenerMap event_listener_map_; |
| 144 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 163 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 145 }; | 164 }; |
| 146 | 165 |
| 147 } // namespace content | 166 } // namespace content |
| 148 | 167 |
| 149 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 168 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| OLD | NEW |