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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Returns whether the guest process has crashed. | 65 // Returns whether the guest process has crashed. |
66 bool guest_crashed() const { return guest_crashed_; } | 66 bool guest_crashed() const { return guest_crashed_; } |
67 | 67 |
68 // Informs the guest of an updated focus state. | 68 // Informs the guest of an updated focus state. |
69 void UpdateGuestFocusState(); | 69 void UpdateGuestFocusState(); |
70 // Indicates whether the guest should be focused. | 70 // Indicates whether the guest should be focused. |
71 bool ShouldGuestBeFocused() const; | 71 bool ShouldGuestBeFocused() const; |
72 | 72 |
73 // Embedder's device scale factor changed, we need to update the guest | 73 // Embedder's device scale factor changed, we need to update the guest |
74 // renderer. | 74 // renderer. |
75 void UpdateDeviceScaleFactor(float device_scale_factor); | 75 void UpdateDeviceScaleFactor(); |
76 | 76 |
77 // A request to enable hardware compositing. | 77 // A request to enable hardware compositing. |
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. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 gfx::Size plugin_size() const { return plugin_rect_.size(); } | 174 gfx::Size plugin_size() const { return plugin_rect_.size(); } |
175 gfx::Rect plugin_rect() const { return plugin_rect_; } | 175 gfx::Rect plugin_rect() const { return plugin_rect_; } |
176 | 176 |
177 // Virtual to allow for mocking in tests. | 177 // Virtual to allow for mocking in tests. |
178 virtual float GetDeviceScaleFactor() const; | 178 virtual float GetDeviceScaleFactor() const; |
179 | 179 |
180 void ShowSadGraphic(); | 180 void ShowSadGraphic(); |
181 | 181 |
182 // Populates BrowserPluginHostMsg_ResizeGuest_Params with resize state. | 182 // Populates BrowserPluginHostMsg_ResizeGuest_Params with resize state. |
183 void PopulateResizeGuestParameters( | 183 void PopulateResizeGuestParameters( |
184 BrowserPluginHostMsg_ResizeGuest_Params* params, | |
185 const gfx::Size& view_size, | 184 const gfx::Size& view_size, |
186 bool needs_repaint); | 185 BrowserPluginHostMsg_ResizeGuest_Params* params); |
187 | |
188 // Populates ResizeGuest parameters based on the current | |
189 // autosize state. | |
190 void GetSizeParams( | |
191 BrowserPluginHostMsg_ResizeGuest_Params* resize_guest_params, | |
192 bool needs_repaint); | |
193 | 186 |
194 // IPC message handlers. | 187 // IPC message handlers. |
195 // Please keep in alphabetical order. | 188 // Please keep in alphabetical order. |
196 void OnAdvanceFocus(int instance_id, bool reverse); | 189 void OnAdvanceFocus(int instance_id, bool reverse); |
197 void OnAttachACK(int browser_plugin_instance_id); | 190 void OnAttachACK(int browser_plugin_instance_id); |
198 void OnBuffersSwapped(int instance_id, | 191 void OnBuffersSwapped(int instance_id, |
199 const FrameMsg_BuffersSwapped_Params& params); | 192 const FrameMsg_BuffersSwapped_Params& params); |
200 void OnCompositorFrameSwapped(const IPC::Message& message); | 193 void OnCompositorFrameSwapped(const IPC::Message& message); |
201 void OnCopyFromCompositingSurface(int instance_id, | 194 void OnCopyFromCompositingSurface(int instance_id, |
202 int request_id, | 195 int request_id, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // 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 |
262 // get called after BrowserPlugin has been destroyed. | 255 // get called after BrowserPlugin has been destroyed. |
263 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 256 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
264 | 257 |
265 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 258 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
266 }; | 259 }; |
267 | 260 |
268 } // namespace content | 261 } // namespace content |
269 | 262 |
270 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 263 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |