Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_impl.h |
| diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h |
| index 18463b35513168e1b4f6ed0bf80ad61bc9e555ce..1b0dbc8db41d2c69773481c0a131478941d15284 100644 |
| --- a/content/browser/frame_host/render_frame_host_impl.h |
| +++ b/content/browser/frame_host/render_frame_host_impl.h |
| @@ -16,6 +16,7 @@ |
| #include "base/time/time.h" |
| #include "content/browser/accessibility/browser_accessibility_manager.h" |
| #include "content/browser/site_instance_impl.h" |
| +#include "content/browser/webui/web_ui_impl.h" |
| #include "content/common/accessibility_mode_enums.h" |
| #include "content/common/ax_content_node_data.h" |
| #include "content/common/content_export.h" |
| @@ -212,6 +213,12 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| RenderFrameHostDelegate* delegate() { return delegate_; } |
| FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
| + // Returns the associated Web UI or nullptr if none applies. |
| + WebUIImpl* web_ui() const { return web_ui_.get(); } |
| + |
| + // Returns the pending associated Web UI, or nullptr of none applies. |
| + WebUIImpl* pending_web_ui() const { return pending_web_ui_.get(); } |
| + |
| // Returns this RenderFrameHost's loading state. This method is only used by |
| // FrameTreeNode. The proper way to check whether a frame is loading is to |
| // call FrameTreeNode::IsLoading. |
| @@ -464,6 +471,14 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| // addition, its associated RenderWidgetHost has to be focused. |
| bool IsFocused(); |
| + void InitializeWebUI(const GURL& dest_url, int past_bindings); |
| + |
| + void UpdatePendingWebUI(const GURL& dest_url, int past_bindings); |
| + |
| + void CommitPendingWebUI(); |
| + |
| + void DiscardPendingWebUI(); |
| + |
| // Returns the Mojo ImageDownloader service. |
| const image_downloader::ImageDownloaderPtr& GetMojoImageDownloader(); |
| @@ -606,6 +621,15 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, |
| ui::AXNodeData* dst); |
| + // Creates a WebUI object for the given URL if one applies and sets |
| + // |web_ui_type| to its type, also ensuring that its bindings match |
| + // |past_bindings| (if provided and different than |
| + // NavigationEntryImpl::kInvalidBindings). If no WebUI applies, returns |
| + // nullptr and resets web_ui_type to WebUI::kNoWebUI. . |
| + scoped_ptr<WebUIImpl> CreateWebUI(const GURL& dest_url, |
| + int past_bindings, |
| + WebUI::TypeID* web_ui_type); |
| + |
| // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| // refcount that calls Shutdown when it reaches zero. This allows each |
| // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| @@ -774,6 +798,24 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| // NavigationHandle for it is owned by the NavigationRequest. |
| scoped_ptr<NavigationHandleImpl> navigation_handle_; |
| + // The associated WebUIImpl and its type. They will be set if the current page |
| + // is a Web UI page. Otherwise they will be nullptr and WebUI::kNoWebUI, |
| + // respectively. |
| + scoped_ptr<WebUIImpl> web_ui_; |
| + WebUI::TypeID web_ui_type_; |
| + |
| + // If either of these is non-NULL, the pending navigation is to a chrome: |
| + // page. The scoped_ptr is used if pending_web_ui_ != web_ui_, the WeakPtr is |
| + // used for when they reference the same object. If either is non-NULL, the |
| + // other should be NULL. |
| + // Note: These are not used in PlzNavigate. |
|
clamy
2015/09/17 17:04:37
Which case would warrant having this in the curren
carlosk
2015/09/30 19:37:27
The comment wasn't yet updated after copy/pasting
|
| + scoped_ptr<WebUIImpl> pending_web_ui_; |
| + WebUI::TypeID pending_web_ui_type_; |
| + |
| + // If true at navigation commit time the current WebUI will be kept instead of |
| + // creating a new one. |
| + bool should_reuse_web_ui_; |
| + |
| // NOTE: This must be the last member. |
| base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |