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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "base/win/scoped_handle.h" | 32 #include "base/win/scoped_handle.h" |
33 #endif | 33 #endif |
34 | 34 |
35 class InterstitialPageImpl; | 35 class InterstitialPageImpl; |
36 class SavePackage; | 36 class SavePackage; |
37 class SessionStorageNamespaceImpl; | 37 class SessionStorageNamespaceImpl; |
38 class WebContentsImpl; | 38 class WebContentsImpl; |
39 struct ViewMsg_PostMessage_Params; | 39 struct ViewMsg_PostMessage_Params; |
40 | 40 |
41 namespace content { | 41 namespace content { |
| 42 class BrowserPluginEmbedder; |
| 43 class BrowserPluginGuest; |
42 class ColorChooser; | 44 class ColorChooser; |
43 class DownloadItem; | 45 class DownloadItem; |
44 class JavaScriptDialogCreator; | 46 class JavaScriptDialogCreator; |
45 class RenderViewHost; | 47 class RenderViewHost; |
46 class RenderViewHostDelegateView; | 48 class RenderViewHostDelegateView; |
47 class RenderViewHostImpl; | 49 class RenderViewHostImpl; |
48 class SiteInstance; | 50 class SiteInstance; |
49 class TestWebContents; | 51 class TestWebContents; |
50 class WebContentsDelegate; | 52 class WebContentsDelegate; |
51 class WebContentsObserver; | 53 class WebContentsObserver; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return java_bridge_dispatcher_host_manager_.get(); | 157 return java_bridge_dispatcher_host_manager_.get(); |
156 } | 158 } |
157 | 159 |
158 content::old::BrowserPluginHost* old_browser_plugin_host() const { | 160 content::old::BrowserPluginHost* old_browser_plugin_host() const { |
159 return old_browser_plugin_host_.get(); | 161 return old_browser_plugin_host_.get(); |
160 } | 162 } |
161 | 163 |
162 // Expose the render manager for testing. | 164 // Expose the render manager for testing. |
163 RenderViewHostManager* GetRenderManagerForTesting(); | 165 RenderViewHostManager* GetRenderManagerForTesting(); |
164 | 166 |
| 167 // Returns guest browser plugin object, or NULL if this WebContents is not a |
| 168 // guest. |
| 169 content::BrowserPluginGuest* GetBrowserPluginGuest(); |
| 170 // Returns embedder browser plugin object, or NULL if this WebContents is not |
| 171 // an embedder. |
| 172 content::BrowserPluginEmbedder* GetBrowserPluginEmbedder(); |
| 173 |
165 // content::WebContents ------------------------------------------------------ | 174 // content::WebContents ------------------------------------------------------ |
166 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; | 175 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; |
167 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; | 176 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; |
168 virtual NavigationControllerImpl& GetController() OVERRIDE; | 177 virtual NavigationControllerImpl& GetController() OVERRIDE; |
169 virtual const NavigationControllerImpl& GetController() const OVERRIDE; | 178 virtual const NavigationControllerImpl& GetController() const OVERRIDE; |
170 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 179 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
171 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; | 180 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; |
172 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; | 181 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; |
173 virtual int GetRoutingID() const OVERRIDE; | 182 virtual int GetRoutingID() const OVERRIDE; |
174 virtual content::RenderWidgetHostView* | 183 virtual content::RenderWidgetHostView* |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); | 554 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); |
546 void OnPepperPluginHung(int plugin_child_id, | 555 void OnPepperPluginHung(int plugin_child_id, |
547 const FilePath& path, | 556 const FilePath& path, |
548 bool is_hung); | 557 bool is_hung); |
549 void OnWebUISend(const GURL& source_url, | 558 void OnWebUISend(const GURL& source_url, |
550 const std::string& name, | 559 const std::string& name, |
551 const base::ListValue& args); | 560 const base::ListValue& args); |
552 void OnRequestPpapiBrokerPermission(int request_id, | 561 void OnRequestPpapiBrokerPermission(int request_id, |
553 const GURL& url, | 562 const GURL& url, |
554 const FilePath& plugin_path); | 563 const FilePath& plugin_path); |
| 564 void OnBrowserPluginNavigateGuest(int instance_id, |
| 565 int64 frame_id, |
| 566 const std::string& src, |
| 567 const gfx::Size& size); |
555 | 568 |
556 // Changes the IsLoading state and notifies delegate as needed | 569 // Changes the IsLoading state and notifies delegate as needed |
557 // |details| is used to provide details on the load that just finished | 570 // |details| is used to provide details on the load that just finished |
558 // (but can be null if not applicable). Can be overridden. | 571 // (but can be null if not applicable). Can be overridden. |
559 void SetIsLoading(bool is_loading, | 572 void SetIsLoading(bool is_loading, |
560 content::LoadNotificationDetails* details); | 573 content::LoadNotificationDetails* details); |
561 | 574 |
562 // Called by derived classes to indicate that we're no longer waiting for a | 575 // Called by derived classes to indicate that we're no longer waiting for a |
563 // response. This won't actually update the throbber, but it will get picked | 576 // response. This won't actually update the throbber, but it will get picked |
564 // up at the next animation step if the throbber is going. | 577 // up at the next animation step if the throbber is going. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 void SaveURL(const GURL& url, | 663 void SaveURL(const GURL& url, |
651 const content::Referrer& referrer, | 664 const content::Referrer& referrer, |
652 bool is_main_frame); | 665 bool is_main_frame); |
653 | 666 |
654 content::RenderViewHostImpl* GetRenderViewHostImpl(); | 667 content::RenderViewHostImpl* GetRenderViewHostImpl(); |
655 | 668 |
656 void GetBrowserPluginEmbedderInfo(content::RenderViewHost* render_view_host, | 669 void GetBrowserPluginEmbedderInfo(content::RenderViewHost* render_view_host, |
657 std::string* embedder_channel_name, | 670 std::string* embedder_channel_name, |
658 int* embedder_container_id); | 671 int* embedder_container_id); |
659 | 672 |
| 673 // Removes browser plugin embedder if there is one and its associated |
| 674 // RenderViewHost has been swapped out. |
| 675 void RemoveSwappedOutBrowserPluginEmbedder(); |
| 676 |
660 // Data for core operation --------------------------------------------------- | 677 // Data for core operation --------------------------------------------------- |
661 | 678 |
662 // Delegate for notifying our owner about stuff. Not owned by us. | 679 // Delegate for notifying our owner about stuff. Not owned by us. |
663 content::WebContentsDelegate* delegate_; | 680 content::WebContentsDelegate* delegate_; |
664 | 681 |
665 // Handles the back/forward list and loading. | 682 // Handles the back/forward list and loading. |
666 NavigationControllerImpl controller_; | 683 NavigationControllerImpl controller_; |
667 | 684 |
668 // The corresponding view. | 685 // The corresponding view. |
669 scoped_ptr<content::WebContentsView> view_; | 686 scoped_ptr<content::WebContentsView> view_; |
(...skipping 27 matching lines...) Expand all Loading... |
697 | 714 |
698 // Manages creation and swapping of render views. | 715 // Manages creation and swapping of render views. |
699 RenderViewHostManager render_manager_; | 716 RenderViewHostManager render_manager_; |
700 | 717 |
701 // Manages injecting Java objects into all RenderViewHosts associated with | 718 // Manages injecting Java objects into all RenderViewHosts associated with |
702 // this WebContentsImpl. | 719 // this WebContentsImpl. |
703 scoped_ptr<JavaBridgeDispatcherHostManager> | 720 scoped_ptr<JavaBridgeDispatcherHostManager> |
704 java_bridge_dispatcher_host_manager_; | 721 java_bridge_dispatcher_host_manager_; |
705 | 722 |
706 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin | 723 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin |
707 // implmentation is complete. | 724 // implementation is complete. |
708 // Manages the browser plugin instances hosted by this WebContents. | 725 // Manages the browser plugin instances hosted by this WebContents. |
709 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_; | 726 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_; |
710 | 727 |
711 // SavePackage, lazily created. | 728 // SavePackage, lazily created. |
712 scoped_refptr<SavePackage> save_package_; | 729 scoped_refptr<SavePackage> save_package_; |
713 | 730 |
714 // Data for loading state ---------------------------------------------------- | 731 // Data for loading state ---------------------------------------------------- |
715 | 732 |
716 // Indicates whether we're currently loading a resource. | 733 // Indicates whether we're currently loading a resource. |
717 bool is_loading_; | 734 bool is_loading_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 // The intrinsic size of the page. | 833 // The intrinsic size of the page. |
817 gfx::Size preferred_size_; | 834 gfx::Size preferred_size_; |
818 | 835 |
819 // Content restrictions, used to disable print/copy etc based on content's | 836 // Content restrictions, used to disable print/copy etc based on content's |
820 // (full-page plugins for now only) permissions. | 837 // (full-page plugins for now only) permissions. |
821 int content_restrictions_; | 838 int content_restrictions_; |
822 | 839 |
823 // Color chooser that was opened by this tab. | 840 // Color chooser that was opened by this tab. |
824 content::ColorChooser* color_chooser_; | 841 content::ColorChooser* color_chooser_; |
825 | 842 |
| 843 // Manages the embedder state for browser plugins, if this WebContents is an |
| 844 // embedder; NULL otherwise. |
| 845 scoped_ptr<content::BrowserPluginEmbedder> browser_plugin_embedder_; |
| 846 // Manages the guest state for browser plugin, if this WebContents is a guest; |
| 847 // NULL otherwise. |
| 848 scoped_ptr<content::BrowserPluginGuest> browser_plugin_guest_; |
| 849 |
826 // This must be at the end, or else we might get notifications and use other | 850 // This must be at the end, or else we might get notifications and use other |
827 // member variables that are gone. | 851 // member variables that are gone. |
828 content::NotificationRegistrar registrar_; | 852 content::NotificationRegistrar registrar_; |
829 | 853 |
830 // Used during IPC message dispatching so that the handlers can get a pointer | 854 // Used during IPC message dispatching so that the handlers can get a pointer |
831 // to the RVH through which the message was received. | 855 // to the RVH through which the message was received. |
832 content::RenderViewHost* message_source_; | 856 content::RenderViewHost* message_source_; |
833 | 857 |
834 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 858 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
835 }; | 859 }; |
836 | 860 |
837 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 861 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |