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 20 matching lines...) Expand all Loading... | |
31 #include "base/win/scoped_handle.h" | 31 #include "base/win/scoped_handle.h" |
32 #endif | 32 #endif |
33 | 33 |
34 class InterstitialPageImpl; | 34 class InterstitialPageImpl; |
35 class SavePackage; | 35 class SavePackage; |
36 class SessionStorageNamespaceImpl; | 36 class SessionStorageNamespaceImpl; |
37 class WebContentsImpl; | 37 class WebContentsImpl; |
38 struct ViewMsg_PostMessage_Params; | 38 struct ViewMsg_PostMessage_Params; |
39 | 39 |
40 namespace content { | 40 namespace content { |
41 class BrowserPluginEmbedder; | |
42 class BrowserPluginGuest; | |
41 class ColorChooser; | 43 class ColorChooser; |
42 class DownloadItem; | 44 class DownloadItem; |
43 class JavaScriptDialogCreator; | 45 class JavaScriptDialogCreator; |
44 class RenderViewHost; | 46 class RenderViewHost; |
45 class RenderViewHostDelegateView; | 47 class RenderViewHostDelegateView; |
46 class RenderViewHostImpl; | 48 class RenderViewHostImpl; |
47 class SiteInstance; | 49 class SiteInstance; |
48 class TestWebContents; | 50 class TestWebContents; |
49 class WebContentsDelegate; | 51 class WebContentsDelegate; |
50 class WebContentsObserver; | 52 class WebContentsObserver; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 return java_bridge_dispatcher_host_manager_.get(); | 156 return java_bridge_dispatcher_host_manager_.get(); |
155 } | 157 } |
156 | 158 |
157 content::old::BrowserPluginHost* old_browser_plugin_host() const { | 159 content::old::BrowserPluginHost* old_browser_plugin_host() const { |
158 return old_browser_plugin_host_.get(); | 160 return old_browser_plugin_host_.get(); |
159 } | 161 } |
160 | 162 |
161 // Expose the render manager for testing. | 163 // Expose the render manager for testing. |
162 RenderViewHostManager* GetRenderManagerForTesting(); | 164 RenderViewHostManager* GetRenderManagerForTesting(); |
163 | 165 |
166 // Sets guest to this WebContents embedder. | |
awong
2012/09/06 00:23:27
I expect a SetXXX() function to take an object tha
lazyboy
2012/09/06 04:33:53
Renamed the function.
There should be no side effe
awong
2012/09/06 19:55:26
Ah, I see. Though looking at this more, this seem
lazyboy
2012/09/07 19:33:19
Embedder and guest can be seen as roles A WC can p
awong
2012/09/07 20:51:03
Yep. I think constructing the right state from the
lazyboy
2012/09/08 02:12:22
Done.
| |
167 content::BrowserPluginGuest* SetBrowserPluginGuest(int instance_id); | |
168 // Returns guest browser plugin object, or NULL if this WebContents is not a | |
169 // guest. | |
170 content::BrowserPluginGuest* GetBrowserPluginGuest(); | |
171 // Returns embedder browser plugin object, or NULL if this WebContents is not | |
172 // an embedder. | |
173 content::BrowserPluginEmbedder* GetBrowserPluginEmbedder(); | |
174 | |
164 // content::WebContents ------------------------------------------------------ | 175 // content::WebContents ------------------------------------------------------ |
165 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; | 176 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; |
166 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; | 177 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; |
167 virtual NavigationControllerImpl& GetController() OVERRIDE; | 178 virtual NavigationControllerImpl& GetController() OVERRIDE; |
168 virtual const NavigationControllerImpl& GetController() const OVERRIDE; | 179 virtual const NavigationControllerImpl& GetController() const OVERRIDE; |
169 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 180 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
170 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; | 181 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; |
171 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; | 182 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; |
172 virtual int GetRoutingID() const OVERRIDE; | 183 virtual int GetRoutingID() const OVERRIDE; |
173 virtual content::RenderWidgetHostView* | 184 virtual content::RenderWidgetHostView* |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); | 546 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); |
536 void OnPepperPluginHung(int plugin_child_id, | 547 void OnPepperPluginHung(int plugin_child_id, |
537 const FilePath& path, | 548 const FilePath& path, |
538 bool is_hung); | 549 bool is_hung); |
539 void OnWebUISend(const GURL& source_url, | 550 void OnWebUISend(const GURL& source_url, |
540 const std::string& name, | 551 const std::string& name, |
541 const base::ListValue& args); | 552 const base::ListValue& args); |
542 void OnRequestPpapiBrokerPermission(int request_id, | 553 void OnRequestPpapiBrokerPermission(int request_id, |
543 const GURL& url, | 554 const GURL& url, |
544 const FilePath& plugin_path); | 555 const FilePath& plugin_path); |
556 void OnBrowserPluginNavigateGuest(int instance_id, | |
557 int64 frame_id, | |
558 std::string src, | |
awong
2012/09/06 00:23:27
Use a const std::string&?
lazyboy
2012/09/06 04:33:53
Done.
| |
559 gfx::Size size); | |
545 | 560 |
546 // Changes the IsLoading state and notifies delegate as needed | 561 // Changes the IsLoading state and notifies delegate as needed |
547 // |details| is used to provide details on the load that just finished | 562 // |details| is used to provide details on the load that just finished |
548 // (but can be null if not applicable). Can be overridden. | 563 // (but can be null if not applicable). Can be overridden. |
549 void SetIsLoading(bool is_loading, | 564 void SetIsLoading(bool is_loading, |
550 content::LoadNotificationDetails* details); | 565 content::LoadNotificationDetails* details); |
551 | 566 |
552 // Called by derived classes to indicate that we're no longer waiting for a | 567 // Called by derived classes to indicate that we're no longer waiting for a |
553 // response. This won't actually update the throbber, but it will get picked | 568 // response. This won't actually update the throbber, but it will get picked |
554 // up at the next animation step if the throbber is going. | 569 // up at the next animation step if the throbber is going. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 void SaveURL(const GURL& url, | 655 void SaveURL(const GURL& url, |
641 const content::Referrer& referrer, | 656 const content::Referrer& referrer, |
642 bool is_main_frame); | 657 bool is_main_frame); |
643 | 658 |
644 content::RenderViewHostImpl* GetRenderViewHostImpl(); | 659 content::RenderViewHostImpl* GetRenderViewHostImpl(); |
645 | 660 |
646 void GetBrowserPluginEmbedderInfo(content::RenderViewHost* render_view_host, | 661 void GetBrowserPluginEmbedderInfo(content::RenderViewHost* render_view_host, |
647 std::string* embedder_channel_name, | 662 std::string* embedder_channel_name, |
648 int* embedder_container_id); | 663 int* embedder_container_id); |
649 | 664 |
665 // Removes browser plugin embedder if there is one and its associated | |
666 // RenderViewHost has been swapped out. | |
667 void RemoveSwappedOutBrowserPluginEmbedder(); | |
668 | |
650 // Data for core operation --------------------------------------------------- | 669 // Data for core operation --------------------------------------------------- |
651 | 670 |
652 // Delegate for notifying our owner about stuff. Not owned by us. | 671 // Delegate for notifying our owner about stuff. Not owned by us. |
653 content::WebContentsDelegate* delegate_; | 672 content::WebContentsDelegate* delegate_; |
654 | 673 |
655 // Handles the back/forward list and loading. | 674 // Handles the back/forward list and loading. |
656 NavigationControllerImpl controller_; | 675 NavigationControllerImpl controller_; |
657 | 676 |
658 // The corresponding view. | 677 // The corresponding view. |
659 scoped_ptr<content::WebContentsView> view_; | 678 scoped_ptr<content::WebContentsView> view_; |
(...skipping 27 matching lines...) Expand all Loading... | |
687 | 706 |
688 // Manages creation and swapping of render views. | 707 // Manages creation and swapping of render views. |
689 RenderViewHostManager render_manager_; | 708 RenderViewHostManager render_manager_; |
690 | 709 |
691 // Manages injecting Java objects into all RenderViewHosts associated with | 710 // Manages injecting Java objects into all RenderViewHosts associated with |
692 // this WebContentsImpl. | 711 // this WebContentsImpl. |
693 scoped_ptr<JavaBridgeDispatcherHostManager> | 712 scoped_ptr<JavaBridgeDispatcherHostManager> |
694 java_bridge_dispatcher_host_manager_; | 713 java_bridge_dispatcher_host_manager_; |
695 | 714 |
696 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin | 715 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin |
697 // implmentation is complete. | 716 // implementation is complete. |
698 // Manages the browser plugin instances hosted by this WebContents. | 717 // Manages the browser plugin instances hosted by this WebContents. |
699 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_; | 718 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_; |
700 | 719 |
701 // SavePackage, lazily created. | 720 // SavePackage, lazily created. |
702 scoped_refptr<SavePackage> save_package_; | 721 scoped_refptr<SavePackage> save_package_; |
703 | 722 |
704 // Data for loading state ---------------------------------------------------- | 723 // Data for loading state ---------------------------------------------------- |
705 | 724 |
706 // Indicates whether we're currently loading a resource. | 725 // Indicates whether we're currently loading a resource. |
707 bool is_loading_; | 726 bool is_loading_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
806 // The intrinsic size of the page. | 825 // The intrinsic size of the page. |
807 gfx::Size preferred_size_; | 826 gfx::Size preferred_size_; |
808 | 827 |
809 // Content restrictions, used to disable print/copy etc based on content's | 828 // Content restrictions, used to disable print/copy etc based on content's |
810 // (full-page plugins for now only) permissions. | 829 // (full-page plugins for now only) permissions. |
811 int content_restrictions_; | 830 int content_restrictions_; |
812 | 831 |
813 // Color chooser that was opened by this tab. | 832 // Color chooser that was opened by this tab. |
814 content::ColorChooser* color_chooser_; | 833 content::ColorChooser* color_chooser_; |
815 | 834 |
835 // Manages the embedder state for browser plugins, if this WebContents is an | |
836 // embedder; NULL otherwise. | |
837 scoped_ptr<content::BrowserPluginEmbedder> browser_plugin_embedder_; | |
838 // Manages the guest state for browser plugin, if this WebContents is a guest; | |
839 // NULL otherwise. | |
840 scoped_ptr<content::BrowserPluginGuest> browser_plugin_guest_; | |
841 | |
816 // This must be at the end, or else we might get notifications and use other | 842 // This must be at the end, or else we might get notifications and use other |
817 // member variables that are gone. | 843 // member variables that are gone. |
818 content::NotificationRegistrar registrar_; | 844 content::NotificationRegistrar registrar_; |
819 | 845 |
820 // Used during IPC message dispatching so that the handlers can get a pointer | 846 // Used during IPC message dispatching so that the handlers can get a pointer |
821 // to the RVH through which the message was received. | 847 // to the RVH through which the message was received. |
822 content::RenderViewHost* message_source_; | 848 content::RenderViewHost* message_source_; |
823 | 849 |
824 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 850 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
825 }; | 851 }; |
826 | 852 |
827 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 853 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |