Chromium Code Reviews| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/property_bag.h" | 16 #include "base/property_bag.h" |
| 17 #include "content/browser/browser_plugin/browser_plugin_web_contents_observer.h" | |
| 18 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h" | 17 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h" |
| 19 #include "content/browser/web_contents/navigation_controller_impl.h" | 18 #include "content/browser/web_contents/navigation_controller_impl.h" |
| 20 #include "content/browser/web_contents/render_view_host_manager.h" | 19 #include "content/browser/web_contents/render_view_host_manager.h" |
| 21 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 22 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 24 #include "content/public/browser/render_view_host_delegate.h" | 23 #include "content/public/browser/render_view_host_delegate.h" |
| 25 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 26 #include "content/public/common/renderer_preferences.h" | 25 #include "content/public/common/renderer_preferences.h" |
| 27 #include "net/base/load_states.h" | 26 #include "net/base/load_states.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 } | 116 } |
| 118 | 117 |
| 119 void set_opener_web_ui_type(content::WebUI::TypeID opener_web_ui_type) { | 118 void set_opener_web_ui_type(content::WebUI::TypeID opener_web_ui_type) { |
| 120 opener_web_ui_type_ = opener_web_ui_type; | 119 opener_web_ui_type_ = opener_web_ui_type; |
| 121 } | 120 } |
| 122 | 121 |
| 123 JavaBridgeDispatcherHostManager* java_bridge_dispatcher_host_manager() const { | 122 JavaBridgeDispatcherHostManager* java_bridge_dispatcher_host_manager() const { |
| 124 return java_bridge_dispatcher_host_manager_.get(); | 123 return java_bridge_dispatcher_host_manager_.get(); |
| 125 } | 124 } |
| 126 | 125 |
| 127 content::BrowserPluginWebContentsObserver* | |
| 128 browser_plugin_web_contents_observer() const { | |
| 129 return browser_plugin_web_contents_observer_.get(); | |
| 130 } | |
| 131 | |
| 132 // Like GetController from WebContents, but returns the concrete object. | 126 // Like GetController from WebContents, but returns the concrete object. |
| 133 NavigationControllerImpl& GetControllerImpl(); | 127 NavigationControllerImpl& GetControllerImpl(); |
| 134 | 128 |
| 135 // Expose the render manager for testing. | 129 // Expose the render manager for testing. |
| 136 RenderViewHostManager* GetRenderManagerForTesting(); | 130 RenderViewHostManager* GetRenderManagerForTesting(); |
| 137 | 131 |
| 138 // content::WebContents ------------------------------------------------------ | 132 // content::WebContents ------------------------------------------------------ |
| 139 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; | 133 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; |
| 140 virtual base::PropertyBag* GetPropertyBag() OVERRIDE; | 134 virtual base::PropertyBag* GetPropertyBag() OVERRIDE; |
| 141 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; | 135 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; |
| 142 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; | 136 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; |
| 143 virtual content::NavigationController& GetController() OVERRIDE; | 137 virtual content::NavigationController& GetController() OVERRIDE; |
| 144 virtual const content::NavigationController& GetController() const OVERRIDE; | 138 virtual const content::NavigationController& GetController() const OVERRIDE; |
| 145 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 139 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
| 146 virtual void SetViewType(content::ViewType type) OVERRIDE; | 140 virtual void SetViewType(content::ViewType type) OVERRIDE; |
| 147 virtual content::ViewType GetViewType() const OVERRIDE; | 141 virtual content::ViewType GetViewType() const OVERRIDE; |
| 148 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; | 142 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; |
| 143 virtual content::RenderProcessHost* | |
| 144 GetPendingRenderProcessHost() const OVERRIDE; | |
|
Charlie Reis
2012/05/11 17:41:03
This is already accessible via the RenderViewHost.
Fady Samuel
2012/05/11 22:03:34
Done.
| |
| 149 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; | 145 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; |
| 146 virtual content::RenderViewHost* GetPendingRenderViewHost() const OVERRIDE; | |
|
Charlie Reis
2012/05/11 17:41:03
I'm hesitant to expose this outside of WebContents
Fady Samuel
2012/05/11 22:03:34
This doesn't really need to be exposed outside the
Charlie Reis
2012/05/11 22:16:47
Would it be possible to put a method on WebContent
| |
| 150 virtual content::RenderWidgetHostView* | 147 virtual content::RenderWidgetHostView* |
| 151 GetRenderWidgetHostView() const OVERRIDE; | 148 GetRenderWidgetHostView() const OVERRIDE; |
| 152 virtual content::WebContentsView* GetView() const OVERRIDE; | 149 virtual content::WebContentsView* GetView() const OVERRIDE; |
| 153 virtual content::WebUI* CreateWebUI(const GURL& url) OVERRIDE; | 150 virtual content::WebUI* CreateWebUI(const GURL& url) OVERRIDE; |
| 154 virtual content::WebUI* GetWebUI() const OVERRIDE; | 151 virtual content::WebUI* GetWebUI() const OVERRIDE; |
| 155 virtual content::WebUI* GetCommittedWebUI() const OVERRIDE; | 152 virtual content::WebUI* GetCommittedWebUI() const OVERRIDE; |
| 156 virtual const string16& GetTitle() const OVERRIDE; | 153 virtual const string16& GetTitle() const OVERRIDE; |
| 157 virtual int32 GetMaxPageID() OVERRIDE; | 154 virtual int32 GetMaxPageID() OVERRIDE; |
| 158 virtual int32 GetMaxPageIDForSiteInstance( | 155 virtual int32 GetMaxPageIDForSiteInstance( |
| 159 content::SiteInstance* site_instance) OVERRIDE; | 156 content::SiteInstance* site_instance) OVERRIDE; |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 // Helper classes ------------------------------------------------------------ | 578 // Helper classes ------------------------------------------------------------ |
| 582 | 579 |
| 583 // Manages creation and swapping of render views. | 580 // Manages creation and swapping of render views. |
| 584 RenderViewHostManager render_manager_; | 581 RenderViewHostManager render_manager_; |
| 585 | 582 |
| 586 // Manages injecting Java objects into all RenderViewHosts associated with | 583 // Manages injecting Java objects into all RenderViewHosts associated with |
| 587 // this WebContentsImpl. | 584 // this WebContentsImpl. |
| 588 scoped_ptr<JavaBridgeDispatcherHostManager> | 585 scoped_ptr<JavaBridgeDispatcherHostManager> |
| 589 java_bridge_dispatcher_host_manager_; | 586 java_bridge_dispatcher_host_manager_; |
| 590 | 587 |
| 591 scoped_ptr<content::BrowserPluginWebContentsObserver> | |
| 592 browser_plugin_web_contents_observer_; | |
| 593 // SavePackage, lazily created. | 588 // SavePackage, lazily created. |
| 594 scoped_refptr<SavePackage> save_package_; | 589 scoped_refptr<SavePackage> save_package_; |
| 595 | 590 |
| 596 // Data for loading state ---------------------------------------------------- | 591 // Data for loading state ---------------------------------------------------- |
| 597 | 592 |
| 598 // Indicates whether we're currently loading a resource. | 593 // Indicates whether we're currently loading a resource. |
| 599 bool is_loading_; | 594 bool is_loading_; |
| 600 | 595 |
| 601 // Indicates if the tab is considered crashed. | 596 // Indicates if the tab is considered crashed. |
| 602 base::TerminationStatus crashed_status_; | 597 base::TerminationStatus crashed_status_; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 705 // Our view type. Default is VIEW_TYPE_WEB_CONTENTS. | 700 // Our view type. Default is VIEW_TYPE_WEB_CONTENTS. |
| 706 content::ViewType view_type_; | 701 content::ViewType view_type_; |
| 707 | 702 |
| 708 // Color chooser that was opened by this tab. | 703 // Color chooser that was opened by this tab. |
| 709 content::ColorChooser* color_chooser_; | 704 content::ColorChooser* color_chooser_; |
| 710 | 705 |
| 711 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 706 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
| 712 }; | 707 }; |
| 713 | 708 |
| 714 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 709 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |