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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 | 48 |
49 // Informs the guest of an updated focus state. | 49 // Informs the guest of an updated focus state. |
50 void UpdateGuestFocusState(blink::WebFocusType focus_type); | 50 void UpdateGuestFocusState(blink::WebFocusType focus_type); |
51 | 51 |
52 // Indicates whether the guest should be focused. | 52 // Indicates whether the guest should be focused. |
53 bool ShouldGuestBeFocused() const; | 53 bool ShouldGuestBeFocused() const; |
54 | 54 |
55 // A request to enable hardware compositing. | 55 // A request to enable hardware compositing. |
56 void EnableCompositing(bool enable); | 56 void EnableCompositing(bool enable); |
57 | 57 |
58 void UpdateInternalInstanceId(); | |
59 | |
60 // Provided that a guest instance ID has been allocated, this method attaches | 58 // Provided that a guest instance ID has been allocated, this method attaches |
61 // this BrowserPlugin instance to that guest. | 59 // this BrowserPlugin instance to that guest. |
62 void Attach(); | 60 void Attach(); |
63 | 61 |
64 // This method detaches this BrowserPlugin instance from the guest that it's | 62 // This method detaches this BrowserPlugin instance from the guest that it's |
65 // currently attached to, if any. | 63 // currently attached to, if any. |
66 void Detach(); | 64 void Detach(); |
67 | 65 |
68 // Notify the plugin about a compositor commit so that frame ACKs could be | 66 // Notify the plugin about a compositor commit so that frame ACKs could be |
69 // sent, if needed. | 67 // sent, if needed. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 // Only the manager is allowed to create a BrowserPlugin. | 137 // Only the manager is allowed to create a BrowserPlugin. |
140 friend class BrowserPluginManager; | 138 friend class BrowserPluginManager; |
141 | 139 |
142 // A BrowserPlugin object is a controller that represents an instance of a | 140 // A BrowserPlugin object is a controller that represents an instance of a |
143 // browser plugin within the embedder renderer process. Once a BrowserPlugin | 141 // browser plugin within the embedder renderer process. Once a BrowserPlugin |
144 // does an initial navigation or is attached to a newly created guest, it | 142 // does an initial navigation or is attached to a newly created guest, it |
145 // acquires a browser_plugin_instance_id as well. The guest instance ID | 143 // acquires a browser_plugin_instance_id as well. The guest instance ID |
146 // uniquely identifies a guest WebContents that's hosted by this | 144 // uniquely identifies a guest WebContents that's hosted by this |
147 // BrowserPlugin. | 145 // BrowserPlugin. |
148 BrowserPlugin(RenderFrame* render_frame, | 146 BrowserPlugin(RenderFrame* render_frame, |
149 scoped_ptr<BrowserPluginDelegate> delegate); | 147 const std::string& mime_type, |
Fady Samuel
2015/06/05 17:31:13
I still don't understand this change? Why not simp
lazyboy
2015/06/05 21:24:00
Done.
| |
148 const GURL& original_url); | |
150 | 149 |
151 ~BrowserPlugin() override; | 150 ~BrowserPlugin() override; |
152 | 151 |
153 gfx::Rect view_rect() const { return view_rect_; } | 152 gfx::Rect view_rect() const { return view_rect_; } |
154 | 153 |
155 void ShowSadGraphic(); | 154 void ShowSadGraphic(); |
156 | 155 |
157 // IPC message handlers. | 156 // IPC message handlers. |
158 // Please keep in alphabetical order. | 157 // Please keep in alphabetical order. |
159 void OnAdvanceFocus(int instance_id, bool reverse); | 158 void OnAdvanceFocus(int instance_id, bool reverse); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; | 193 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
195 | 194 |
196 // URL for the embedder frame. | 195 // URL for the embedder frame. |
197 int browser_plugin_instance_id_; | 196 int browser_plugin_instance_id_; |
198 | 197 |
199 // Indicates whether the guest content is opaque. | 198 // Indicates whether the guest content is opaque. |
200 bool contents_opaque_; | 199 bool contents_opaque_; |
201 | 200 |
202 std::vector<EditCommand> edit_commands_; | 201 std::vector<EditCommand> edit_commands_; |
203 | 202 |
204 scoped_ptr<BrowserPluginDelegate> delegate_; | 203 // Once set, ownership is transfered to our shadow root HTML element's GC. |
204 BrowserPluginDelegate* delegate_; | |
205 | |
206 const std::string mime_type_; | |
207 const GURL original_url_; | |
205 | 208 |
206 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 209 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
207 // get called after BrowserPlugin has been destroyed. | 210 // get called after BrowserPlugin has been destroyed. |
208 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 211 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
209 | 212 |
210 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 213 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
211 }; | 214 }; |
212 | 215 |
213 } // namespace content | 216 } // namespace content |
214 | 217 |
215 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 218 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |