OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // A BrowserPluginGuest represents the browser side of browser <--> renderer | 5 // A BrowserPluginGuest represents the browser side of browser <--> renderer |
6 // communication. A BrowserPlugin (a WebPlugin) is on the renderer side of | 6 // communication. A BrowserPlugin (a WebPlugin) is on the renderer side of |
7 // browser <--> guest renderer communication. The 'guest' renderer is a | 7 // browser <--> guest renderer communication. The 'guest' renderer is a |
8 // <browser> tag. | 8 // <browser> tag. |
9 // | 9 // |
10 // BrowserPluginGuest lives on the UI thread of the browser process. It has a | 10 // BrowserPluginGuest lives on the UI thread of the browser process. It has a |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 void set_guest_hang_timeout_for_testing(const base::TimeDelta& timeout) { | 78 void set_guest_hang_timeout_for_testing(const base::TimeDelta& timeout) { |
79 guest_hang_timeout_ = timeout; | 79 guest_hang_timeout_ = timeout; |
80 } | 80 } |
81 | 81 |
82 void set_embedder_render_process_host( | 82 void set_embedder_render_process_host( |
83 RenderProcessHost* render_process_host) { | 83 RenderProcessHost* render_process_host) { |
84 embedder_render_process_host_ = render_process_host; | 84 embedder_render_process_host_ = render_process_host; |
85 } | 85 } |
86 | 86 |
| 87 void set_embedder_web_contents(WebContents* web_contents) { |
| 88 embedder_web_contents_ = web_contents; |
| 89 } |
| 90 |
87 bool visible() const { return visible_; } | 91 bool visible() const { return visible_; } |
88 | 92 |
89 // NotificationObserver implementation. | 93 // NotificationObserver implementation. |
90 virtual void Observe(int type, | 94 virtual void Observe(int type, |
91 const NotificationSource& source, | 95 const NotificationSource& source, |
92 const NotificationDetails& details) OVERRIDE; | 96 const NotificationDetails& details) OVERRIDE; |
93 | 97 |
94 // WebContentsObserver implementation. | 98 // WebContentsObserver implementation. |
95 virtual void DidStartProvisionalLoadForFrame( | 99 virtual void DidStartProvisionalLoadForFrame( |
96 int64 frame_id, | 100 int64 frame_id, |
(...skipping 15 matching lines...) Expand all Loading... |
112 PageTransition transition_type, | 116 PageTransition transition_type, |
113 RenderViewHost* render_view_host) OVERRIDE; | 117 RenderViewHost* render_view_host) OVERRIDE; |
114 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 118 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
115 | 119 |
116 // WebContentsDelegate implementation. | 120 // WebContentsDelegate implementation. |
117 virtual bool CanDownload(RenderViewHost* render_view_host, | 121 virtual bool CanDownload(RenderViewHost* render_view_host, |
118 int request_id, | 122 int request_id, |
119 const std::string& request_method) OVERRIDE; | 123 const std::string& request_method) OVERRIDE; |
120 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; | 124 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; |
121 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; | 125 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; |
| 126 virtual void RunFileChooser(WebContents* web_contents, |
| 127 const FileChooserParams& params) OVERRIDE; |
122 | 128 |
123 void UpdateRect(RenderViewHost* render_view_host, | 129 void UpdateRect(RenderViewHost* render_view_host, |
124 const ViewHostMsg_UpdateRect_Params& params); | 130 const ViewHostMsg_UpdateRect_Params& params); |
125 void UpdateRectACK(int message_id, const gfx::Size& size); | 131 void UpdateRectACK(int message_id, const gfx::Size& size); |
126 // Handles input event routed through the embedder (which is initiated in the | 132 // Handles input event routed through the embedder (which is initiated in the |
127 // browser plugin (renderer side of the embedder)). | 133 // browser plugin (renderer side of the embedder)). |
128 void HandleInputEvent(RenderViewHost* render_view_host, | 134 void HandleInputEvent(RenderViewHost* render_view_host, |
129 const gfx::Rect& guest_rect, | 135 const gfx::Rect& guest_rect, |
130 const WebKit::WebInputEvent& event, | 136 const WebKit::WebInputEvent& event, |
131 IPC::Message* reply_message); | 137 IPC::Message* reply_message); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // Called when a redirect notification occurs. | 217 // Called when a redirect notification occurs. |
212 void LoadRedirect(const GURL& old_url, | 218 void LoadRedirect(const GURL& old_url, |
213 const GURL& new_url, | 219 const GURL& new_url, |
214 bool is_top_level); | 220 bool is_top_level); |
215 | 221 |
216 // Static factory instance (always NULL for non-test). | 222 // Static factory instance (always NULL for non-test). |
217 static content::BrowserPluginHostFactory* factory_; | 223 static content::BrowserPluginHostFactory* factory_; |
218 | 224 |
219 NotificationRegistrar notification_registrar_; | 225 NotificationRegistrar notification_registrar_; |
220 RenderProcessHost* embedder_render_process_host_; | 226 RenderProcessHost* embedder_render_process_host_; |
| 227 WebContents* embedder_web_contents_; |
221 // An identifier that uniquely identifies a browser plugin guest within an | 228 // An identifier that uniquely identifies a browser plugin guest within an |
222 // embedder. | 229 // embedder. |
223 int instance_id_; | 230 int instance_id_; |
224 scoped_ptr<TransportDIB> damage_buffer_; | 231 scoped_ptr<TransportDIB> damage_buffer_; |
225 #if defined(OS_WIN) | 232 #if defined(OS_WIN) |
226 size_t damage_buffer_size_; | 233 size_t damage_buffer_size_; |
227 #endif | 234 #endif |
228 gfx::Size damage_view_size_; | 235 gfx::Size damage_view_size_; |
229 float damage_buffer_scale_factor_; | 236 float damage_buffer_scale_factor_; |
230 scoped_ptr<IPC::Message> pending_input_event_reply_; | 237 scoped_ptr<IPC::Message> pending_input_event_reply_; |
231 gfx::Rect guest_rect_; | 238 gfx::Rect guest_rect_; |
232 WebCursor cursor_; | 239 WebCursor cursor_; |
233 IDMap<RenderViewHost> pending_updates_; | 240 IDMap<RenderViewHost> pending_updates_; |
234 int pending_update_counter_; | 241 int pending_update_counter_; |
235 base::TimeDelta guest_hang_timeout_; | 242 base::TimeDelta guest_hang_timeout_; |
236 bool visible_; | 243 bool visible_; |
237 | 244 |
238 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 245 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
239 }; | 246 }; |
240 | 247 |
241 } // namespace content | 248 } // namespace content |
242 | 249 |
243 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 250 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |