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 void UpdateInternalInstanceId(); | 66 void UpdateInternalInstanceId(); |
59 | 67 |
60 // Provided that a guest instance ID has been allocated, this method attaches | 68 // Provided that a guest instance ID has been allocated, this method attaches |
61 // this BrowserPlugin instance to that guest. | 69 // this BrowserPlugin instance to that guest. |
62 void Attach(); | 70 void Attach(); |
63 | 71 |
64 // This method detaches this BrowserPlugin instance from the guest that it's | 72 // This method detaches this BrowserPlugin instance from the guest that it's |
65 // currently attached to, if any. | 73 // currently attached to, if any. |
66 void Detach(); | 74 void Detach(); |
67 | 75 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 160 |
153 gfx::Rect view_rect() const { return view_rect_; } | 161 gfx::Rect view_rect() const { return view_rect_; } |
154 | 162 |
155 void ShowSadGraphic(); | 163 void ShowSadGraphic(); |
156 | 164 |
157 // IPC message handlers. | 165 // IPC message handlers. |
158 // Please keep in alphabetical order. | 166 // Please keep in alphabetical order. |
159 void OnAdvanceFocus(int instance_id, bool reverse); | 167 void OnAdvanceFocus(int instance_id, bool reverse); |
160 void OnCompositorFrameSwapped(const IPC::Message& message); | 168 void OnCompositorFrameSwapped(const IPC::Message& message); |
161 void OnGuestGone(int instance_id); | 169 void OnGuestGone(int instance_id); |
| 170 void OnSetChildFrameSurface(int instance_id, |
| 171 const cc::SurfaceId& surface_id, |
| 172 const gfx::Size& frame_size, |
| 173 float scale_factor, |
| 174 const cc::SurfaceSequence& sequence); |
162 void OnSetContentsOpaque(int instance_id, bool opaque); | 175 void OnSetContentsOpaque(int instance_id, bool opaque); |
163 void OnSetCursor(int instance_id, const WebCursor& cursor); | 176 void OnSetCursor(int instance_id, const WebCursor& cursor); |
164 void OnSetMouseLock(int instance_id, bool enable); | 177 void OnSetMouseLock(int instance_id, bool enable); |
165 void OnSetTooltipText(int browser_plugin_instance_id, | 178 void OnSetTooltipText(int browser_plugin_instance_id, |
166 const base::string16& tooltip_text); | 179 const base::string16& tooltip_text); |
167 void OnShouldAcceptTouchEvents(int instance_id, bool accept); | 180 void OnShouldAcceptTouchEvents(int instance_id, bool accept); |
168 | 181 |
169 // This indicates whether this BrowserPlugin has been attached to a | 182 // This indicates whether this BrowserPlugin has been attached to a |
170 // WebContents and is ready to receive IPCs. | 183 // WebContents and is ready to receive IPCs. |
171 bool attached_; | 184 bool attached_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 219 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
207 // get called after BrowserPlugin has been destroyed. | 220 // get called after BrowserPlugin has been destroyed. |
208 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 221 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
209 | 222 |
210 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 223 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
211 }; | 224 }; |
212 | 225 |
213 } // namespace content | 226 } // namespace content |
214 | 227 |
215 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 228 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |