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 BrowserPluginHostEmbedderRole; |
| 43 class BrowserPluginHostGuestRole; |
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 content::old::BrowserPluginHost* old_browser_plugin_host() const { | 147 content::old::BrowserPluginHost* old_browser_plugin_host() const { |
146 return old_browser_plugin_host_.get(); | 148 return old_browser_plugin_host_.get(); |
147 } | 149 } |
148 | 150 |
149 // Like GetController from WebContents, but returns the concrete object. | 151 // Like GetController from WebContents, but returns the concrete object. |
150 NavigationControllerImpl& GetControllerImpl(); | 152 NavigationControllerImpl& GetControllerImpl(); |
151 | 153 |
152 // Expose the render manager for testing. | 154 // Expose the render manager for testing. |
153 RenderViewHostManager* GetRenderManagerForTesting(); | 155 RenderViewHostManager* GetRenderManagerForTesting(); |
154 | 156 |
| 157 // Adds browser plugin 'guest' role to this class. |
| 158 content::BrowserPluginHostGuestRole* AddGuestRole( |
| 159 int instance_id, |
| 160 content::RenderProcessHost* render_process_host); |
| 161 // Exposes guest/embedder role so browser plugin delegates are accessible from |
| 162 // a WebContents instance. Having such (non-NULL) delegate indicates that the |
| 163 // WebContents has assumed the corresponding (guest or embedder) role. |
| 164 content::BrowserPluginHostGuestRole* GetGuestRole(); |
| 165 content::BrowserPluginHostEmbedderRole* GetEmbedderRole(); |
| 166 |
155 // content::WebContents ------------------------------------------------------ | 167 // content::WebContents ------------------------------------------------------ |
156 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; | 168 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; |
157 virtual base::PropertyBag* GetPropertyBag() OVERRIDE; | 169 virtual base::PropertyBag* GetPropertyBag() OVERRIDE; |
158 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; | 170 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; |
159 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; | 171 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; |
160 virtual content::NavigationController& GetController() OVERRIDE; | 172 virtual content::NavigationController& GetController() OVERRIDE; |
161 virtual const content::NavigationController& GetController() const OVERRIDE; | 173 virtual const content::NavigationController& GetController() const OVERRIDE; |
162 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 174 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
163 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; | 175 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; |
164 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; | 176 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy); | 524 void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy); |
513 void OnOpenColorChooser(int color_chooser_id, SkColor color); | 525 void OnOpenColorChooser(int color_chooser_id, SkColor color); |
514 void OnEndColorChooser(int color_chooser_id); | 526 void OnEndColorChooser(int color_chooser_id); |
515 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); | 527 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); |
516 void OnPepperPluginHung(int plugin_child_id, | 528 void OnPepperPluginHung(int plugin_child_id, |
517 const FilePath& path, | 529 const FilePath& path, |
518 bool is_hung); | 530 bool is_hung); |
519 void OnWebUISend(const GURL& source_url, | 531 void OnWebUISend(const GURL& source_url, |
520 const std::string& name, | 532 const std::string& name, |
521 const base::ListValue& args); | 533 const base::ListValue& args); |
| 534 void OnBrowserPluginNavigateGuest(int instance_id, |
| 535 int64 frame_id, |
| 536 std::string src, |
| 537 gfx::Size size); |
522 | 538 |
523 // Changes the IsLoading state and notifies delegate as needed | 539 // Changes the IsLoading state and notifies delegate as needed |
524 // |details| is used to provide details on the load that just finished | 540 // |details| is used to provide details on the load that just finished |
525 // (but can be null if not applicable). Can be overridden. | 541 // (but can be null if not applicable). Can be overridden. |
526 void SetIsLoading(bool is_loading, | 542 void SetIsLoading(bool is_loading, |
527 content::LoadNotificationDetails* details); | 543 content::LoadNotificationDetails* details); |
528 | 544 |
529 // Called by derived classes to indicate that we're no longer waiting for a | 545 // Called by derived classes to indicate that we're no longer waiting for a |
530 // response. This won't actually update the throbber, but it will get picked | 546 // response. This won't actually update the throbber, but it will get picked |
531 // up at the next animation step if the throbber is going. | 547 // up at the next animation step if the throbber is going. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 | 684 |
669 // Manages creation and swapping of render views. | 685 // Manages creation and swapping of render views. |
670 RenderViewHostManager render_manager_; | 686 RenderViewHostManager render_manager_; |
671 | 687 |
672 // Manages injecting Java objects into all RenderViewHosts associated with | 688 // Manages injecting Java objects into all RenderViewHosts associated with |
673 // this WebContentsImpl. | 689 // this WebContentsImpl. |
674 scoped_ptr<JavaBridgeDispatcherHostManager> | 690 scoped_ptr<JavaBridgeDispatcherHostManager> |
675 java_bridge_dispatcher_host_manager_; | 691 java_bridge_dispatcher_host_manager_; |
676 | 692 |
677 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin | 693 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin |
678 // implmentation is complete. | 694 // implementation is complete. |
679 // Manages the browser plugin instances hosted by this WebContents. | 695 // Manages the browser plugin instances hosted by this WebContents. |
680 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_; | 696 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_; |
681 | 697 |
682 // SavePackage, lazily created. | 698 // SavePackage, lazily created. |
683 scoped_refptr<SavePackage> save_package_; | 699 scoped_refptr<SavePackage> save_package_; |
684 | 700 |
685 // Data for loading state ---------------------------------------------------- | 701 // Data for loading state ---------------------------------------------------- |
686 | 702 |
687 // Indicates whether we're currently loading a resource. | 703 // Indicates whether we're currently loading a resource. |
688 bool is_loading_; | 704 bool is_loading_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 // The intrinsic size of the page. | 803 // The intrinsic size of the page. |
788 gfx::Size preferred_size_; | 804 gfx::Size preferred_size_; |
789 | 805 |
790 // Content restrictions, used to disable print/copy etc based on content's | 806 // Content restrictions, used to disable print/copy etc based on content's |
791 // (full-page plugins for now only) permissions. | 807 // (full-page plugins for now only) permissions. |
792 int content_restrictions_; | 808 int content_restrictions_; |
793 | 809 |
794 // Color chooser that was opened by this tab. | 810 // Color chooser that was opened by this tab. |
795 content::ColorChooser* color_chooser_; | 811 content::ColorChooser* color_chooser_; |
796 | 812 |
| 813 // Roles for WebContents to act as guest and/or embedder. |
| 814 scoped_ptr<content::BrowserPluginHostEmbedderRole> embedder_role_; |
| 815 scoped_ptr<content::BrowserPluginHostGuestRole> guest_role_; |
| 816 |
797 // This must be at the end, or else we might get notifications and use other | 817 // This must be at the end, or else we might get notifications and use other |
798 // member variables that are gone. | 818 // member variables that are gone. |
799 content::NotificationRegistrar registrar_; | 819 content::NotificationRegistrar registrar_; |
800 | 820 |
801 // Used during IPC message dispatching so that the handlers can get a pointer | 821 // Used during IPC message dispatching so that the handlers can get a pointer |
802 // to the RVH through which the message was received. | 822 // to the RVH through which the message was received. |
803 content::RenderViewHost* message_source_; | 823 content::RenderViewHost* message_source_; |
804 | 824 |
805 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 825 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
806 }; | 826 }; |
807 | 827 |
808 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 828 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |