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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // embedder) instead of default view/widget host. | 138 // embedder) instead of default view/widget host. |
139 void HandleInputEventAck(RenderViewHost* render_view_host, bool handled); | 139 void HandleInputEventAck(RenderViewHost* render_view_host, bool handled); |
140 | 140 |
141 // Helper to send messages to embedder. Overridden in test implementation | 141 // Helper to send messages to embedder. Overridden in test implementation |
142 // since we want to intercept certain messages for testing. | 142 // since we want to intercept certain messages for testing. |
143 virtual void SendMessageToEmbedder(IPC::Message* msg); | 143 virtual void SendMessageToEmbedder(IPC::Message* msg); |
144 // Overridden in tests. | 144 // Overridden in tests. |
145 virtual void SetFocus(bool focused); | 145 virtual void SetFocus(bool focused); |
146 // Overridden in tests. | 146 // Overridden in tests. |
147 virtual bool ViewTakeFocus(bool reverse); | 147 virtual bool ViewTakeFocus(bool reverse); |
| 148 // Reload the guest. |
| 149 virtual void Reload(); |
| 150 // Stop loading the guest. |
| 151 virtual void Stop(); |
148 | 152 |
149 // Static factory instance (always NULL for non-test). | 153 // Static factory instance (always NULL for non-test). |
150 static content::BrowserPluginHostFactory* factory_; | 154 static content::BrowserPluginHostFactory* factory_; |
151 | 155 |
152 RenderProcessHost* embedder_render_process_host_; | 156 RenderProcessHost* embedder_render_process_host_; |
153 // An identifier that uniquely identifies a browser plugin guest within an | 157 // An identifier that uniquely identifies a browser plugin guest within an |
154 // embedder. | 158 // embedder. |
155 int instance_id_; | 159 int instance_id_; |
156 scoped_ptr<TransportDIB> damage_buffer_; | 160 scoped_ptr<TransportDIB> damage_buffer_; |
157 #if defined(OS_WIN) | 161 #if defined(OS_WIN) |
158 size_t damage_buffer_size_; | 162 size_t damage_buffer_size_; |
159 #endif | 163 #endif |
160 gfx::Size damage_view_size_; | 164 gfx::Size damage_view_size_; |
161 float damage_buffer_scale_factor_; | 165 float damage_buffer_scale_factor_; |
162 scoped_ptr<IPC::Message> pending_input_event_reply_; | 166 scoped_ptr<IPC::Message> pending_input_event_reply_; |
163 gfx::Rect guest_rect_; | 167 gfx::Rect guest_rect_; |
164 WebCursor cursor_; | 168 WebCursor cursor_; |
165 IDMap<RenderViewHost> pending_updates_; | 169 IDMap<RenderViewHost> pending_updates_; |
166 int pending_update_counter_; | 170 int pending_update_counter_; |
167 base::TimeDelta guest_hang_timeout_; | 171 base::TimeDelta guest_hang_timeout_; |
168 | 172 |
169 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 173 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
170 }; | 174 }; |
171 | 175 |
172 } // namespace content | 176 } // namespace content |
173 | 177 |
174 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 178 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |