| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 int64 frame_id, | 86 int64 frame_id, |
| 87 bool is_main_frame, | 87 bool is_main_frame, |
| 88 const GURL& url, | 88 const GURL& url, |
| 89 PageTransition transition_type, | 89 PageTransition transition_type, |
| 90 RenderViewHost* render_view_host) OVERRIDE; | 90 RenderViewHost* render_view_host) OVERRIDE; |
| 91 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 91 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 92 | 92 |
| 93 // WebContentsDelegate implementation. | 93 // WebContentsDelegate implementation. |
| 94 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; | 94 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; |
| 95 | 95 |
| 96 void SetDamageBuffer(TransportDIB* damage_buffer, | |
| 97 #if defined(OS_WIN) | |
| 98 int damage_buffer_size, | |
| 99 #endif | |
| 100 const gfx::Size& damage_view_size, | |
| 101 float scale_factor); | |
| 102 | |
| 103 void UpdateRect(RenderViewHost* render_view_host, | 96 void UpdateRect(RenderViewHost* render_view_host, |
| 104 const ViewHostMsg_UpdateRect_Params& params); | 97 const ViewHostMsg_UpdateRect_Params& params); |
| 105 void UpdateRectACK(int message_id, const gfx::Size& size); | 98 void UpdateRectACK(int message_id, const gfx::Size& size); |
| 106 // Handles input event routed through the embedder (which is initiated in the | 99 // Handles input event routed through the embedder (which is initiated in the |
| 107 // browser plugin (renderer side of the embedder)). | 100 // browser plugin (renderer side of the embedder)). |
| 108 void HandleInputEvent(RenderViewHost* render_view_host, | 101 void HandleInputEvent(RenderViewHost* render_view_host, |
| 109 const gfx::Rect& guest_rect, | 102 const gfx::Rect& guest_rect, |
| 110 const WebKit::WebInputEvent& event, | 103 const WebKit::WebInputEvent& event, |
| 111 IPC::Message* reply_message); | 104 IPC::Message* reply_message); |
| 112 // Overrides default ShowWidget message so we show them on the correct | 105 // Overrides default ShowWidget message so we show them on the correct |
| (...skipping 17 matching lines...) Expand all Loading... |
| 130 virtual bool ViewTakeFocus(bool reverse); | 123 virtual bool ViewTakeFocus(bool reverse); |
| 131 // If possible, navigate the guest to |relative_index| entries away from the | 124 // If possible, navigate the guest to |relative_index| entries away from the |
| 132 // current navigation entry. | 125 // current navigation entry. |
| 133 virtual void Go(int relative_index); | 126 virtual void Go(int relative_index); |
| 134 // Overridden in tests. | 127 // Overridden in tests. |
| 135 virtual void SetFocus(bool focused); | 128 virtual void SetFocus(bool focused); |
| 136 // Reload the guest. | 129 // Reload the guest. |
| 137 virtual void Reload(); | 130 virtual void Reload(); |
| 138 // Stop loading the guest. | 131 // Stop loading the guest. |
| 139 virtual void Stop(); | 132 virtual void Stop(); |
| 133 // Overridden in tests. |
| 134 virtual void SetDamageBuffer(TransportDIB* damage_buffer, |
| 135 #if defined(OS_WIN) |
| 136 int damage_buffer_size, |
| 137 #endif |
| 138 const gfx::Size& damage_view_size, |
| 139 float scale_factor); |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 friend class TestBrowserPluginGuest; | 142 friend class TestBrowserPluginGuest; |
| 143 | 143 |
| 144 BrowserPluginGuest(int instance_id, | 144 BrowserPluginGuest(int instance_id, |
| 145 WebContentsImpl* web_contents, | 145 WebContentsImpl* web_contents, |
| 146 RenderViewHost* render_view_host); | 146 RenderViewHost* render_view_host); |
| 147 | 147 |
| 148 RenderProcessHost* embedder_render_process_host() { | 148 RenderProcessHost* embedder_render_process_host() { |
| 149 return embedder_render_process_host_; | 149 return embedder_render_process_host_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 180 IDMap<RenderViewHost> pending_updates_; | 180 IDMap<RenderViewHost> pending_updates_; |
| 181 int pending_update_counter_; | 181 int pending_update_counter_; |
| 182 base::TimeDelta guest_hang_timeout_; | 182 base::TimeDelta guest_hang_timeout_; |
| 183 | 183 |
| 184 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 184 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 } // namespace content | 187 } // namespace content |
| 188 | 188 |
| 189 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 189 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |