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/mouse_lock_dispatcher.h" | 13 #include "content/renderer/mouse_lock_dispatcher.h" |
14 #include "content/renderer/render_view_impl.h" | 14 #include "content/renderer/render_view_impl.h" |
15 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 15 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
16 #include "third_party/WebKit/public/web/WebDragStatus.h" | 16 #include "third_party/WebKit/public/web/WebDragStatus.h" |
17 #include "third_party/WebKit/public/web/WebNode.h" | 17 #include "third_party/WebKit/public/web/WebNode.h" |
18 #include "third_party/WebKit/public/web/WebWidget.h" | 18 #include "third_party/WebKit/public/web/WebWidget.h" |
19 | 19 |
20 struct BrowserPluginHostMsg_ResizeGuest_Params; | 20 struct BrowserPluginHostMsg_ResizeGuest_Params; |
21 struct FrameMsg_BuffersSwapped_Params; | 21 struct FrameMsg_BuffersSwapped_Params; |
22 | 22 |
| 23 namespace cc { |
| 24 struct SurfaceId; |
| 25 struct SurfaceSequence; |
| 26 } |
| 27 |
23 namespace content { | 28 namespace content { |
24 | 29 |
25 class BrowserPluginDelegate; | 30 class BrowserPluginDelegate; |
26 class BrowserPluginManager; | 31 class BrowserPluginManager; |
27 class ChildFrameCompositingHelper; | 32 class ChildFrameCompositingHelper; |
28 | 33 |
29 class CONTENT_EXPORT BrowserPlugin : | 34 class CONTENT_EXPORT BrowserPlugin : |
30 NON_EXPORTED_BASE(public blink::WebPlugin), | 35 NON_EXPORTED_BASE(public blink::WebPlugin), |
31 public MouseLockDispatcher::LockTarget { | 36 public MouseLockDispatcher::LockTarget { |
32 public: | 37 public: |
(...skipping 15 matching lines...) Expand all Loading... |
48 | 53 |
49 // Informs the guest of an updated focus state. | 54 // Informs the guest of an updated focus state. |
50 void UpdateGuestFocusState(blink::WebFocusType focus_type); | 55 void UpdateGuestFocusState(blink::WebFocusType focus_type); |
51 | 56 |
52 // Indicates whether the guest should be focused. | 57 // Indicates whether the guest should be focused. |
53 bool ShouldGuestBeFocused() const; | 58 bool ShouldGuestBeFocused() const; |
54 | 59 |
55 // A request to enable hardware compositing. | 60 // A request to enable hardware compositing. |
56 void EnableCompositing(bool enable); | 61 void EnableCompositing(bool enable); |
57 | 62 |
| 63 // Called by CompositingHelper to send current SurfaceSequence to browser. |
| 64 void SendSatisfySequence(const cc::SurfaceSequence& sequence); |
| 65 |
58 // Provided that a guest instance ID has been allocated, this method attaches | 66 // Provided that a guest instance ID has been allocated, this method attaches |
59 // this BrowserPlugin instance to that guest. | 67 // this BrowserPlugin instance to that guest. |
60 void Attach(); | 68 void Attach(); |
61 | 69 |
62 // This method detaches this BrowserPlugin instance from the guest that it's | 70 // This method detaches this BrowserPlugin instance from the guest that it's |
63 // currently attached to, if any. | 71 // currently attached to, if any. |
64 void Detach(); | 72 void Detach(); |
65 | 73 |
66 // Notify the plugin about a compositor commit so that frame ACKs could be | 74 // Notify the plugin about a compositor commit so that frame ACKs could be |
67 // sent, if needed. | 75 // sent, if needed. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 gfx::Rect view_rect() const { return view_rect_; } | 159 gfx::Rect view_rect() const { return view_rect_; } |
152 | 160 |
153 void ShowSadGraphic(); | 161 void ShowSadGraphic(); |
154 void UpdateInternalInstanceId(); | 162 void UpdateInternalInstanceId(); |
155 | 163 |
156 // IPC message handlers. | 164 // IPC message handlers. |
157 // Please keep in alphabetical order. | 165 // Please keep in alphabetical order. |
158 void OnAdvanceFocus(int instance_id, bool reverse); | 166 void OnAdvanceFocus(int instance_id, bool reverse); |
159 void OnCompositorFrameSwapped(const IPC::Message& message); | 167 void OnCompositorFrameSwapped(const IPC::Message& message); |
160 void OnGuestGone(int instance_id); | 168 void OnGuestGone(int instance_id); |
| 169 void OnSetChildFrameSurface(int instance_id, |
| 170 const cc::SurfaceId& surface_id, |
| 171 const gfx::Size& frame_size, |
| 172 float scale_factor, |
| 173 const cc::SurfaceSequence& sequence); |
161 void OnSetContentsOpaque(int instance_id, bool opaque); | 174 void OnSetContentsOpaque(int instance_id, bool opaque); |
162 void OnSetCursor(int instance_id, const WebCursor& cursor); | 175 void OnSetCursor(int instance_id, const WebCursor& cursor); |
163 void OnSetMouseLock(int instance_id, bool enable); | 176 void OnSetMouseLock(int instance_id, bool enable); |
164 void OnSetTooltipText(int browser_plugin_instance_id, | 177 void OnSetTooltipText(int browser_plugin_instance_id, |
165 const base::string16& tooltip_text); | 178 const base::string16& tooltip_text); |
166 void OnShouldAcceptTouchEvents(int instance_id, bool accept); | 179 void OnShouldAcceptTouchEvents(int instance_id, bool accept); |
167 | 180 |
168 // This indicates whether this BrowserPlugin has been attached to a | 181 // This indicates whether this BrowserPlugin has been attached to a |
169 // WebContents and is ready to receive IPCs. | 182 // WebContents and is ready to receive IPCs. |
170 bool attached_; | 183 bool attached_; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 220 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
208 // get called after BrowserPlugin has been destroyed. | 221 // get called after BrowserPlugin has been destroyed. |
209 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 222 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
210 | 223 |
211 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 224 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
212 }; | 225 }; |
213 | 226 |
214 } // namespace content | 227 } // namespace content |
215 | 228 |
216 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 229 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |