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" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void EnableCompositing(bool enable); | 78 void EnableCompositing(bool enable); |
79 | 79 |
80 // Provided that a guest instance ID has been allocated, this method attaches | 80 // Provided that a guest instance ID has been allocated, this method attaches |
81 // this BrowserPlugin instance to that guest. | 81 // this BrowserPlugin instance to that guest. |
82 void Attach(); | 82 void Attach(); |
83 | 83 |
84 // Notify the plugin about a compositor commit so that frame ACKs could be | 84 // Notify the plugin about a compositor commit so that frame ACKs could be |
85 // sent, if needed. | 85 // sent, if needed. |
86 void DidCommitCompositorFrame(); | 86 void DidCommitCompositorFrame(); |
87 | 87 |
88 static BrowserPlugin* FromNode(blink::WebNode& node); | |
89 | |
90 // Returns whether a message should be forwarded to BrowserPlugin. | 88 // Returns whether a message should be forwarded to BrowserPlugin. |
91 static bool ShouldForwardToBrowserPlugin(const IPC::Message& message); | 89 static bool ShouldForwardToBrowserPlugin(const IPC::Message& message); |
92 | 90 |
93 // blink::WebPlugin implementation. | 91 // blink::WebPlugin implementation. |
94 virtual blink::WebPluginContainer* container() const OVERRIDE; | 92 virtual blink::WebPluginContainer* container() const OVERRIDE; |
95 virtual bool initialize(blink::WebPluginContainer* container) OVERRIDE; | 93 virtual bool initialize(blink::WebPluginContainer* container) OVERRIDE; |
96 virtual void destroy() OVERRIDE; | 94 virtual void destroy() OVERRIDE; |
97 virtual NPObject* scriptableObject() OVERRIDE; | 95 virtual NPObject* scriptableObject() OVERRIDE; |
98 virtual struct _NPP* pluginNPP() OVERRIDE; | 96 virtual struct _NPP* pluginNPP() OVERRIDE; |
99 virtual bool supportsKeyboardFocus() const OVERRIDE; | 97 virtual bool supportsKeyboardFocus() const OVERRIDE; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 261 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
264 // get called after BrowserPlugin has been destroyed. | 262 // get called after BrowserPlugin has been destroyed. |
265 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 263 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
266 | 264 |
267 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 265 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
268 }; | 266 }; |
269 | 267 |
270 } // namespace content | 268 } // namespace content |
271 | 269 |
272 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 270 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |