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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // WebContentsDelegate implementation. | 116 // WebContentsDelegate implementation. |
117 virtual bool CanDownload(RenderViewHost* render_view_host, | 117 virtual bool CanDownload(RenderViewHost* render_view_host, |
118 int request_id, | 118 int request_id, |
119 const std::string& request_method) OVERRIDE; | 119 const std::string& request_method) OVERRIDE; |
120 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; | 120 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; |
121 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; | 121 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; |
122 | 122 |
123 void UpdateRect(RenderViewHost* render_view_host, | 123 void UpdateRect(RenderViewHost* render_view_host, |
124 const ViewHostMsg_UpdateRect_Params& params); | 124 const ViewHostMsg_UpdateRect_Params& params); |
125 void UpdateRectACK(int message_id, const gfx::Size& size); | 125 void UpdateRectACK(int message_id, const gfx::Size& size); |
126 // Handles input event routed through the embedder (which is initiated in the | |
127 // browser plugin (renderer side of the embedder)). | |
128 void HandleInputEvent(RenderViewHost* render_view_host, | |
129 const gfx::Rect& guest_rect, | |
130 const WebKit::WebInputEvent& event, | |
131 IPC::Message* reply_message); | |
132 // Overrides default ShowWidget message so we show them on the correct | 126 // Overrides default ShowWidget message so we show them on the correct |
133 // coordinates. | 127 // coordinates. |
134 void ShowWidget(RenderViewHost* render_view_host, | 128 void ShowWidget(RenderViewHost* render_view_host, |
135 int route_id, | 129 int route_id, |
136 const gfx::Rect& initial_pos); | 130 const gfx::Rect& initial_pos); |
137 void SetCursor(const WebCursor& cursor); | 131 void SetCursor(const WebCursor& cursor); |
138 // Handles input event acks so they are sent to browser plugin host (via | 132 // Handles input event acks so they are sent to browser plugin host (via |
139 // embedder) instead of default view/widget host. | 133 // embedder) instead of default view/widget host. |
140 void HandleInputEventAck(RenderViewHost* render_view_host, bool handled); | 134 void HandleInputEventAck(RenderViewHost* render_view_host, bool handled); |
141 | 135 |
(...skipping 18 matching lines...) Expand all Loading... |
160 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). | 154 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). |
161 void SetVisibility(bool embedder_visible, bool visible); | 155 void SetVisibility(bool embedder_visible, bool visible); |
162 | 156 |
163 // Exposes the protected web_contents() from WebContentsObserver. | 157 // Exposes the protected web_contents() from WebContentsObserver. |
164 WebContents* GetWebContents(); | 158 WebContents* GetWebContents(); |
165 | 159 |
166 // Kill the guest process. | 160 // Kill the guest process. |
167 void Terminate(); | 161 void Terminate(); |
168 | 162 |
169 // Overridden in tests. | 163 // Overridden in tests. |
| 164 // Handles input event routed through the embedder (which is initiated in the |
| 165 // browser plugin (renderer side of the embedder)). |
| 166 virtual void HandleInputEvent(RenderViewHost* render_view_host, |
| 167 const gfx::Rect& guest_rect, |
| 168 const WebKit::WebInputEvent& event, |
| 169 IPC::Message* reply_message); |
170 virtual bool ViewTakeFocus(bool reverse); | 170 virtual bool ViewTakeFocus(bool reverse); |
171 // If possible, navigate the guest to |relative_index| entries away from the | 171 // If possible, navigate the guest to |relative_index| entries away from the |
172 // current navigation entry. | 172 // current navigation entry. |
173 virtual void Go(int relative_index); | 173 virtual void Go(int relative_index); |
174 // Overridden in tests. | 174 // Overridden in tests. |
175 virtual void SetFocus(bool focused); | 175 virtual void SetFocus(bool focused); |
176 // Reload the guest. | 176 // Reload the guest. |
177 virtual void Reload(); | 177 virtual void Reload(); |
178 // Stop loading the guest. | 178 // Stop loading the guest. |
179 virtual void Stop(); | 179 virtual void Stop(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 int pending_update_counter_; | 234 int pending_update_counter_; |
235 base::TimeDelta guest_hang_timeout_; | 235 base::TimeDelta guest_hang_timeout_; |
236 bool visible_; | 236 bool visible_; |
237 | 237 |
238 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 238 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
239 }; | 239 }; |
240 | 240 |
241 } // namespace content | 241 } // namespace content |
242 | 242 |
243 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 243 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |