Index: content/browser/web_contents/web_contents_impl.h |
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h |
index e9d29e4f59d5be984e8ca84c20350c91c00c7fbe..df95bfcac1c07b4b26ef5ac03f04e33d5495577c 100644 |
--- a/content/browser/web_contents/web_contents_impl.h |
+++ b/content/browser/web_contents/web_contents_impl.h |
@@ -132,10 +132,13 @@ class CONTENT_EXPORT WebContentsImpl |
static std::vector<WebContentsImpl*> GetAllWebContents(); |
- static WebContentsImpl* FromFrameTreeNode(FrameTreeNode* frame_tree_node); |
+ static WebContentsImpl* FromFrameTreeNode( |
+ const FrameTreeNode* frame_tree_node); |
static WebContents* FromRenderFrameHostID(int render_process_host_id, |
int render_frame_host_id); |
static WebContents* FromFrameTreeNodeId(int frame_tree_node_id); |
+ static WebContentsImpl* FromOuterFrameTreeNode( |
+ const FrameTreeNode* frame_tree_node); |
// Complex initialization here. Specifically needed to avoid having |
// members call back into our virtual functions in the constructor. |
@@ -268,6 +271,24 @@ class CONTENT_EXPORT WebContentsImpl |
// interface. |
WebContentsBindingSet* GetBindingSet(const std::string& interface_name); |
+ // Returns the focused WebContents. |
+ // If there are multiple inner/outer WebContents (when embedding <webview>, |
+ // <guestview>, ...) returns the single one containing the currently focused |
+ // frame. Otherwise, returns this WebContents. |
+ WebContentsImpl* GetFocusedWebContents(); |
+ |
+ // TODO(paulmeyer): Once GuestViews are no longer implemented as |
+ // BrowserPluginGuests, frame traversal across WebContents should be moved to |
+ // be handled by FrameTreeNode, and |GetInnerWebContents| and |
+ // |GetWebContentsAndAllInner| can be removed. |
+ |
+ // Returns a vector to the inner WebContents within this WebContents. |
+ std::vector<WebContentsImpl*> GetInnerWebContents(); |
+ |
+ // Returns a vector containing this WebContents and all inner WebContents |
+ // within it (recursively). |
+ std::vector<WebContentsImpl*> GetWebContentsAndAllInner(); |
+ |
// WebContents ------------------------------------------------------ |
WebContentsDelegate* GetDelegate() override; |
void SetDelegate(WebContentsDelegate* delegate) override; |
@@ -811,6 +832,10 @@ class CONTENT_EXPORT WebContentsImpl |
// |IsFullscreen| must return |true| when this method is called. |
bool HasActiveEffectivelyFullscreenVideo() const; |
+ // Called by this WebContents's BrowserPluginGuest (if one exists) to indicate |
+ // that the guest will be destroyed. |
+ void BrowserPluginGuestWillDestroy(); |
+ |
#if defined(OS_ANDROID) |
// Called by FindRequestManager when all of the find match rects are in. |
void NotifyFindMatchRectsReply(int version, |
@@ -886,7 +911,16 @@ class CONTENT_EXPORT WebContentsImpl |
WebContentsImpl* focused_web_contents() { return focused_web_contents_; } |
void SetFocusedWebContents(WebContentsImpl* web_contents); |
+ // Returns the inner WebContents within |frame|, if one exists, or nullptr |
+ // otherwise. |
+ WebContentsImpl* GetInnerWebContentsInFrame(const FrameTreeNode* frame); |
+ |
+ const std::vector<WebContentsImpl*>& inner_web_contents() const; |
+ |
private: |
+ void AttachInnerWebContents(WebContentsImpl* inner_web_contents); |
+ void DetachInnerWebContents(WebContentsImpl* inner_web_contents); |
+ |
// FrameTreeNode::Observer implementation. |
void OnFrameTreeNodeDestroyed(FrameTreeNode* node) final; |
@@ -901,6 +935,9 @@ class CONTENT_EXPORT WebContentsImpl |
// |current_web_contents_| as an inner WebContents. |
int outer_contents_frame_tree_node_id_; |
+ // List of inner WebContents that we host. |
+ std::vector<WebContentsImpl*> inner_web_contents_; |
+ |
// Only the root node should have this set. This indicates the WebContents |
// whose frame tree has the focused frame. The WebContents tree could be |
// arbitrarily deep. |
@@ -1078,12 +1115,6 @@ class CONTENT_EXPORT WebContentsImpl |
// receive page focus and blur events when the containing window changes focus |
// state. |
- // Returns the focused WebContents. |
- // If there are multiple inner/outer WebContents (when embedding <webview>, |
- // <guestview>, ...) returns the single one containing the currently focused |
- // frame. Otherwise, returns this WebContents. |
- WebContentsImpl* GetFocusedWebContents(); |
- |
// Returns true if |this| is the focused WebContents or an ancestor of the |
// focused WebContents. |
bool ContainsOrIsFocusedWebContents(); |
@@ -1192,7 +1223,11 @@ class CONTENT_EXPORT WebContentsImpl |
void SetJavaScriptDialogManagerForTesting( |
JavaScriptDialogManager* dialog_manager); |
- // Returns the FindRequestManager, or creates one if it doesn't already exist. |
+ // Returns the FindRequestManager, which may be found in an outer WebContents. |
+ FindRequestManager* GetFindRequestManager(); |
+ |
+ // Returns the FindRequestManager, or creates one if it doesn't already |
+ // exist. The FindRequestManager may be found in an outer WebContents. |
FindRequestManager* GetOrCreateFindRequestManager(); |
// Removes a registered WebContentsBindingSet by interface name. |