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 |
| 132 // Expose the pending RenderViewHost for use by Browser Plugin cross-process |
| 133 // navigation. |
| 134 content::RenderViewHost* GetPendingRenderViewHost() const; |
| 135 |
138 // content::WebContents ------------------------------------------------------ | 136 // content::WebContents ------------------------------------------------------ |
139 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; | 137 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; |
140 virtual base::PropertyBag* GetPropertyBag() OVERRIDE; | 138 virtual base::PropertyBag* GetPropertyBag() OVERRIDE; |
141 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; | 139 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; |
142 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; | 140 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; |
143 virtual content::NavigationController& GetController() OVERRIDE; | 141 virtual content::NavigationController& GetController() OVERRIDE; |
144 virtual const content::NavigationController& GetController() const OVERRIDE; | 142 virtual const content::NavigationController& GetController() const OVERRIDE; |
145 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 143 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
146 virtual void SetViewType(content::ViewType type) OVERRIDE; | 144 virtual void SetViewType(content::ViewType type) OVERRIDE; |
147 virtual content::ViewType GetViewType() const OVERRIDE; | 145 virtual content::ViewType GetViewType() const OVERRIDE; |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 // Helper classes ------------------------------------------------------------ | 579 // Helper classes ------------------------------------------------------------ |
582 | 580 |
583 // Manages creation and swapping of render views. | 581 // Manages creation and swapping of render views. |
584 RenderViewHostManager render_manager_; | 582 RenderViewHostManager render_manager_; |
585 | 583 |
586 // Manages injecting Java objects into all RenderViewHosts associated with | 584 // Manages injecting Java objects into all RenderViewHosts associated with |
587 // this WebContentsImpl. | 585 // this WebContentsImpl. |
588 scoped_ptr<JavaBridgeDispatcherHostManager> | 586 scoped_ptr<JavaBridgeDispatcherHostManager> |
589 java_bridge_dispatcher_host_manager_; | 587 java_bridge_dispatcher_host_manager_; |
590 | 588 |
591 scoped_ptr<content::BrowserPluginWebContentsObserver> | |
592 browser_plugin_web_contents_observer_; | |
593 // SavePackage, lazily created. | 589 // SavePackage, lazily created. |
594 scoped_refptr<SavePackage> save_package_; | 590 scoped_refptr<SavePackage> save_package_; |
595 | 591 |
596 // Data for loading state ---------------------------------------------------- | 592 // Data for loading state ---------------------------------------------------- |
597 | 593 |
598 // Indicates whether we're currently loading a resource. | 594 // Indicates whether we're currently loading a resource. |
599 bool is_loading_; | 595 bool is_loading_; |
600 | 596 |
601 // Indicates if the tab is considered crashed. | 597 // Indicates if the tab is considered crashed. |
602 base::TerminationStatus crashed_status_; | 598 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. | 701 // Our view type. Default is VIEW_TYPE_WEB_CONTENTS. |
706 content::ViewType view_type_; | 702 content::ViewType view_type_; |
707 | 703 |
708 // Color chooser that was opened by this tab. | 704 // Color chooser that was opened by this tab. |
709 content::ColorChooser* color_chooser_; | 705 content::ColorChooser* color_chooser_; |
710 | 706 |
711 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 707 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
712 }; | 708 }; |
713 | 709 |
714 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 710 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |