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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // If a new window is created with target="_blank" and rel="noreferrer", then | 175 // If a new window is created with target="_blank" and rel="noreferrer", then |
176 // this method is called, indicating that the new WebContents is ready to be | 176 // this method is called, indicating that the new WebContents is ready to be |
177 // attached. | 177 // attached. |
178 virtual void AddNewContents(WebContents* source, | 178 virtual void AddNewContents(WebContents* source, |
179 WebContents* new_contents, | 179 WebContents* new_contents, |
180 WindowOpenDisposition disposition, | 180 WindowOpenDisposition disposition, |
181 const gfx::Rect& initial_pos, | 181 const gfx::Rect& initial_pos, |
182 bool user_gesture, | 182 bool user_gesture, |
183 bool* was_blocked) OVERRIDE; | 183 bool* was_blocked) OVERRIDE; |
184 virtual void CanDownload(RenderViewHost* render_view_host, | 184 virtual void CanDownload(RenderViewHost* render_view_host, |
185 int request_id, | 185 const GURL& url, |
186 const std::string& request_method, | 186 const std::string& request_method, |
187 const base::Callback<void(bool)>& callback) OVERRIDE; | 187 const base::Callback<void(bool)>& callback) OVERRIDE; |
188 virtual void LoadProgressChanged(WebContents* source, | 188 virtual void LoadProgressChanged(WebContents* source, |
189 double progress) OVERRIDE; | 189 double progress) OVERRIDE; |
190 virtual void CloseContents(WebContents* source) OVERRIDE; | 190 virtual void CloseContents(WebContents* source) OVERRIDE; |
191 virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE; | 191 virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE; |
192 virtual ColorChooser* OpenColorChooser( | 192 virtual ColorChooser* OpenColorChooser( |
193 WebContents* web_contents, | 193 WebContents* web_contents, |
194 SkColor color, | 194 SkColor color, |
195 const std::vector<ColorSuggestion>& suggestions) OVERRIDE; | 195 const std::vector<ColorSuggestion>& suggestions) OVERRIDE; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 440 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
441 #endif | 441 #endif |
442 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 442 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
443 // Overridden in tests. | 443 // Overridden in tests. |
444 virtual void OnTakeFocus(bool reverse); | 444 virtual void OnTakeFocus(bool reverse); |
445 void OnUpdateFrameName(int frame_id, | 445 void OnUpdateFrameName(int frame_id, |
446 bool is_top_level, | 446 bool is_top_level, |
447 const std::string& name); | 447 const std::string& name); |
448 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 448 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
449 | 449 |
450 // Requests download permission through embedder JavaScript API after | |
451 // retrieving url information from IO thread. | |
452 void DidRetrieveDownloadURLFromRequestId( | |
453 const std::string& request_method, | |
454 const base::Callback<void(bool)>& callback, | |
455 const GURL& url); | |
456 | |
457 // Forwards all messages from the |pending_messages_| queue to the embedder. | 450 // Forwards all messages from the |pending_messages_| queue to the embedder. |
458 void SendQueuedMessages(); | 451 void SendQueuedMessages(); |
459 | 452 |
460 // Static factory instance (always NULL for non-test). | 453 // Static factory instance (always NULL for non-test). |
461 static BrowserPluginHostFactory* factory_; | 454 static BrowserPluginHostFactory* factory_; |
462 | 455 |
463 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; | 456 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; |
464 WebContentsImpl* embedder_web_contents_; | 457 WebContentsImpl* embedder_web_contents_; |
465 | 458 |
466 // An identifier that uniquely identifies a browser plugin guest within an | 459 // An identifier that uniquely identifies a browser plugin guest within an |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 522 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
530 // permission. | 523 // permission. |
531 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 524 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
532 | 525 |
533 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 526 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
534 }; | 527 }; |
535 | 528 |
536 } // namespace content | 529 } // namespace content |
537 | 530 |
538 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 531 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |