OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/public/web/WebPlugin.h" | 8 #include "third_party/WebKit/public/web/WebPlugin.h" |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/sequenced_task_runner_helpers.h" | 12 #include "base/sequenced_task_runner_helpers.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/mouse_lock_dispatcher.h" | 14 #include "content/renderer/mouse_lock_dispatcher.h" |
15 #include "content/renderer/render_view_impl.h" | 15 #include "content/renderer/render_view_impl.h" |
16 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 16 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
17 #include "third_party/WebKit/public/web/WebDragStatus.h" | 17 #include "third_party/WebKit/public/web/WebDragStatus.h" |
| 18 #include "third_party/WebKit/public/web/WebNode.h" |
18 #include "third_party/WebKit/public/web/WebWidget.h" | 19 #include "third_party/WebKit/public/web/WebWidget.h" |
19 | 20 |
20 struct BrowserPluginHostMsg_ResizeGuest_Params; | 21 struct BrowserPluginHostMsg_ResizeGuest_Params; |
21 struct BrowserPluginMsg_UpdateRect_Params; | 22 struct BrowserPluginMsg_UpdateRect_Params; |
22 struct FrameMsg_BuffersSwapped_Params; | 23 struct FrameMsg_BuffersSwapped_Params; |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
26 class BrowserPluginDelegate; | 27 class BrowserPluginDelegate; |
27 class ChildFrameCompositingHelper; | 28 class ChildFrameCompositingHelper; |
28 class BrowserPluginManager; | 29 class BrowserPluginManager; |
29 class MockBrowserPlugin; | 30 class MockBrowserPlugin; |
30 | 31 |
31 class CONTENT_EXPORT BrowserPlugin : | 32 class CONTENT_EXPORT BrowserPlugin : |
32 NON_EXPORTED_BASE(public blink::WebPlugin), | 33 NON_EXPORTED_BASE(public blink::WebPlugin), |
33 public MouseLockDispatcher::LockTarget { | 34 public MouseLockDispatcher::LockTarget { |
34 public: | 35 public: |
| 36 static BrowserPlugin* GetFromNode(blink::WebNode& node); |
| 37 |
35 RenderViewImpl* render_view() const { return render_view_.get(); } | 38 RenderViewImpl* render_view() const { return render_view_.get(); } |
36 int render_view_routing_id() const { return render_view_routing_id_; } | 39 int render_view_routing_id() const { return render_view_routing_id_; } |
37 int browser_plugin_instance_id() const { return browser_plugin_instance_id_; } | 40 int browser_plugin_instance_id() const { return browser_plugin_instance_id_; } |
38 bool attached() const { return attached_; } | 41 bool attached() const { return attached_; } |
39 bool ready() const { return attached_ || attach_pending_; } | 42 bool ready() const { return attached_ || attach_pending_; } |
40 BrowserPluginManager* browser_plugin_manager() const { | 43 BrowserPluginManager* browser_plugin_manager() const { |
41 return browser_plugin_manager_.get(); | 44 return browser_plugin_manager_.get(); |
42 } | 45 } |
43 | 46 |
44 bool OnMessageReceived(const IPC::Message& msg); | 47 bool OnMessageReceived(const IPC::Message& msg); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 254 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
252 // get called after BrowserPlugin has been destroyed. | 255 // get called after BrowserPlugin has been destroyed. |
253 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 256 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
254 | 257 |
255 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 258 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
256 }; | 259 }; |
257 | 260 |
258 } // namespace content | 261 } // namespace content |
259 | 262 |
260 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 263 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |