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 is the browser side of a browser <--> embedder | 5 // A BrowserPluginGuest is the browser side of a browser <--> embedder |
6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder | 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder |
7 // renderer side of browser <--> embedder renderer communication. | 7 // renderer side of browser <--> embedder renderer communication. |
8 // | 8 // |
9 // BrowserPluginGuest lives on the UI thread of the browser process. Any | 9 // BrowserPluginGuest lives on the UI thread of the browser process. Any |
10 // messages about the guest render process that the embedder might be interested | 10 // messages about the guest render process that the embedder might be interested |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 BrowserPluginGuest* opener() const { return opener_.get(); } | 140 BrowserPluginGuest* opener() const { return opener_.get(); } |
141 | 141 |
142 // Returns whether the mouse pointer was unlocked. | 142 // Returns whether the mouse pointer was unlocked. |
143 bool UnlockMouseIfNecessary(const NativeWebKeyboardEvent& event); | 143 bool UnlockMouseIfNecessary(const NativeWebKeyboardEvent& event); |
144 | 144 |
145 void UpdateVisibility(); | 145 void UpdateVisibility(); |
146 | 146 |
147 // WebContentsObserver implementation. | 147 // WebContentsObserver implementation. |
148 virtual void DidCommitProvisionalLoadForFrame( | 148 virtual void DidCommitProvisionalLoadForFrame( |
149 int64 frame_id, | 149 int64 frame_id, |
150 const string16& frame_unique_name, | 150 const base::string16& frame_unique_name, |
151 bool is_main_frame, | 151 bool is_main_frame, |
152 const GURL& url, | 152 const GURL& url, |
153 PageTransition transition_type, | 153 PageTransition transition_type, |
154 RenderViewHost* render_view_host) OVERRIDE; | 154 RenderViewHost* render_view_host) OVERRIDE; |
155 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE; | 155 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE; |
156 | 156 |
157 virtual void RenderViewReady() OVERRIDE; | 157 virtual void RenderViewReady() OVERRIDE; |
158 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 158 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
159 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 159 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
160 | 160 |
161 // WebContentsDelegate implementation. | 161 // WebContentsDelegate implementation. |
162 virtual bool AddMessageToConsole(WebContents* source, | 162 virtual bool AddMessageToConsole(WebContents* source, |
163 int32 level, | 163 int32 level, |
164 const string16& message, | 164 const base::string16& message, |
165 int32 line_no, | 165 int32 line_no, |
166 const string16& source_id) OVERRIDE; | 166 const base::string16& source_id) OVERRIDE; |
167 // If a new window is created with target="_blank" and rel="noreferrer", then | 167 // If a new window is created with target="_blank" and rel="noreferrer", then |
168 // this method is called, indicating that the new WebContents is ready to be | 168 // this method is called, indicating that the new WebContents is ready to be |
169 // attached. | 169 // attached. |
170 virtual void AddNewContents(WebContents* source, | 170 virtual void AddNewContents(WebContents* source, |
171 WebContents* new_contents, | 171 WebContents* new_contents, |
172 WindowOpenDisposition disposition, | 172 WindowOpenDisposition disposition, |
173 const gfx::Rect& initial_pos, | 173 const gfx::Rect& initial_pos, |
174 bool user_gesture, | 174 bool user_gesture, |
175 bool* was_blocked) OVERRIDE; | 175 bool* was_blocked) OVERRIDE; |
176 virtual void CanDownload(RenderViewHost* render_view_host, | 176 virtual void CanDownload(RenderViewHost* render_view_host, |
177 int request_id, | 177 int request_id, |
178 const std::string& request_method, | 178 const std::string& request_method, |
179 const base::Callback<void(bool)>& callback) OVERRIDE; | 179 const base::Callback<void(bool)>& callback) OVERRIDE; |
180 virtual void LoadProgressChanged(WebContents* source, | 180 virtual void LoadProgressChanged(WebContents* source, |
181 double progress) OVERRIDE; | 181 double progress) OVERRIDE; |
182 virtual void CloseContents(WebContents* source) OVERRIDE; | 182 virtual void CloseContents(WebContents* source) OVERRIDE; |
183 virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE; | 183 virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE; |
184 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; | 184 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; |
185 virtual void HandleKeyboardEvent( | 185 virtual void HandleKeyboardEvent( |
186 WebContents* source, | 186 WebContents* source, |
187 const NativeWebKeyboardEvent& event) OVERRIDE; | 187 const NativeWebKeyboardEvent& event) OVERRIDE; |
188 virtual WebContents* OpenURLFromTab(WebContents* source, | 188 virtual WebContents* OpenURLFromTab(WebContents* source, |
189 const OpenURLParams& params) OVERRIDE; | 189 const OpenURLParams& params) OVERRIDE; |
190 virtual void WebContentsCreated(WebContents* source_contents, | 190 virtual void WebContentsCreated(WebContents* source_contents, |
191 int64 source_frame_id, | 191 int64 source_frame_id, |
192 const string16& frame_name, | 192 const base::string16& frame_name, |
193 const GURL& target_url, | 193 const GURL& target_url, |
194 WebContents* new_contents) OVERRIDE; | 194 WebContents* new_contents) OVERRIDE; |
195 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; | 195 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; |
196 virtual void RendererResponsive(WebContents* source) OVERRIDE; | 196 virtual void RendererResponsive(WebContents* source) OVERRIDE; |
197 virtual void RunFileChooser(WebContents* web_contents, | 197 virtual void RunFileChooser(WebContents* web_contents, |
198 const FileChooserParams& params) OVERRIDE; | 198 const FileChooserParams& params) OVERRIDE; |
199 virtual bool ShouldFocusPageAfterCrash() OVERRIDE; | 199 virtual bool ShouldFocusPageAfterCrash() OVERRIDE; |
200 virtual void RequestMediaAccessPermission( | 200 virtual void RequestMediaAccessPermission( |
201 WebContents* web_contents, | 201 WebContents* web_contents, |
202 const MediaStreamRequest& request, | 202 const MediaStreamRequest& request, |
203 const MediaResponseCallback& callback) OVERRIDE; | 203 const MediaResponseCallback& callback) OVERRIDE; |
204 | 204 |
205 // JavaScriptDialogManager implementation. | 205 // JavaScriptDialogManager implementation. |
206 virtual void RunJavaScriptDialog( | 206 virtual void RunJavaScriptDialog( |
207 WebContents* web_contents, | 207 WebContents* web_contents, |
208 const GURL& origin_url, | 208 const GURL& origin_url, |
209 const std::string& accept_lang, | 209 const std::string& accept_lang, |
210 JavaScriptMessageType javascript_message_type, | 210 JavaScriptMessageType javascript_message_type, |
211 const string16& message_text, | 211 const base::string16& message_text, |
212 const string16& default_prompt_text, | 212 const base::string16& default_prompt_text, |
213 const DialogClosedCallback& callback, | 213 const DialogClosedCallback& callback, |
214 bool* did_suppress_message) OVERRIDE; | 214 bool* did_suppress_message) OVERRIDE; |
215 virtual void RunBeforeUnloadDialog( | 215 virtual void RunBeforeUnloadDialog( |
216 WebContents* web_contents, | 216 WebContents* web_contents, |
217 const string16& message_text, | 217 const base::string16& message_text, |
218 bool is_reload, | 218 bool is_reload, |
219 const DialogClosedCallback& callback) OVERRIDE; | 219 const DialogClosedCallback& callback) OVERRIDE; |
220 virtual bool HandleJavaScriptDialog(WebContents* web_contents, | 220 virtual bool HandleJavaScriptDialog( |
221 bool accept, | 221 WebContents* web_contents, |
222 const string16* prompt_override) OVERRIDE; | 222 bool accept, |
| 223 const base::string16* prompt_override) OVERRIDE; |
223 virtual void CancelActiveAndPendingDialogs( | 224 virtual void CancelActiveAndPendingDialogs( |
224 WebContents* web_contents) OVERRIDE; | 225 WebContents* web_contents) OVERRIDE; |
225 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; | 226 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; |
226 | 227 |
227 // Exposes the protected web_contents() from WebContentsObserver. | 228 // Exposes the protected web_contents() from WebContentsObserver. |
228 WebContentsImpl* GetWebContents(); | 229 WebContentsImpl* GetWebContents(); |
229 | 230 |
230 // Overridden in tests. | 231 // Overridden in tests. |
231 virtual void SetDamageBuffer( | 232 virtual void SetDamageBuffer( |
232 const BrowserPluginHostMsg_ResizeGuest_Params& params); | 233 const BrowserPluginHostMsg_ResizeGuest_Params& params); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 // These are parameters passed from JavaScript on attachment to the content | 560 // These are parameters passed from JavaScript on attachment to the content |
560 // embedder. | 561 // embedder. |
561 scoped_ptr<base::DictionaryValue> extra_attach_params_; | 562 scoped_ptr<base::DictionaryValue> extra_attach_params_; |
562 | 563 |
563 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 564 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
564 }; | 565 }; |
565 | 566 |
566 } // namespace content | 567 } // namespace content |
567 | 568 |
568 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 569 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |