Commit add16aa8 authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

Make WebContents::GetOuterWebContents() const.

Change-Id: I60d5a327f7f0ad22dccdbdcbe15dbfaf89f98918
Reviewed-on: https://chromium-review.googlesource.com/c/1302493Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603972}
parent bd942c98
...@@ -5417,7 +5417,7 @@ void WebContentsImpl::RemoveBrowserPluginEmbedder() { ...@@ -5417,7 +5417,7 @@ void WebContentsImpl::RemoveBrowserPluginEmbedder() {
browser_plugin_embedder_.reset(); browser_plugin_embedder_.reset();
} }
WebContentsImpl* WebContentsImpl::GetOuterWebContents() { WebContentsImpl* WebContentsImpl::GetOuterWebContents() const {
if (GuestMode::IsCrossProcessFrameGuest(this)) if (GuestMode::IsCrossProcessFrameGuest(this))
return node_.outer_web_contents(); return node_.outer_web_contents();
......
...@@ -360,7 +360,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, ...@@ -360,7 +360,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void AttachToOuterWebContentsFrame( void AttachToOuterWebContentsFrame(
std::unique_ptr<WebContents> current_web_contents, std::unique_ptr<WebContents> current_web_contents,
RenderFrameHost* outer_contents_frame) override; RenderFrameHost* outer_contents_frame) override;
WebContentsImpl* GetOuterWebContents() override; WebContentsImpl* GetOuterWebContents() const override;
WebContentsImpl* GetOutermostWebContents() override; WebContentsImpl* GetOutermostWebContents() override;
void DidChangeVisibleSecurityState() override; void DidChangeVisibleSecurityState() override;
void NotifyPreferencesChanged() override; void NotifyPreferencesChanged() override;
......
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
namespace content { namespace content {
// static // static
bool GuestMode::IsCrossProcessFrameGuest(WebContents* web_contents) { bool GuestMode::IsCrossProcessFrameGuest(const WebContents* web_contents) {
BrowserPluginGuest* browser_plugin_guest = BrowserPluginGuest* browser_plugin_guest =
static_cast<WebContentsImpl*>(web_contents)->GetBrowserPluginGuest(); static_cast<const WebContentsImpl*>(web_contents)
->GetBrowserPluginGuest();
if (!browser_plugin_guest || if (!browser_plugin_guest ||
!browser_plugin_guest->can_use_cross_process_frames()) { !browser_plugin_guest->can_use_cross_process_frames()) {
......
...@@ -16,7 +16,7 @@ class CONTENT_EXPORT GuestMode { ...@@ -16,7 +16,7 @@ class CONTENT_EXPORT GuestMode {
public: public:
// Returns true if |web_contents| is an inner WebContents based on cross // Returns true if |web_contents| is an inner WebContents based on cross
// process frames. // process frames.
static bool IsCrossProcessFrameGuest(WebContents* web_contents); static bool IsCrossProcessFrameGuest(const WebContents* web_contents);
private: private:
GuestMode(); GuestMode();
......
...@@ -535,7 +535,7 @@ class WebContents : public PageNavigator, ...@@ -535,7 +535,7 @@ class WebContents : public PageNavigator,
// Returns the outer WebContents of this WebContents if any. // Returns the outer WebContents of this WebContents if any.
// Otherwise, return nullptr. // Otherwise, return nullptr.
virtual WebContents* GetOuterWebContents() = 0; virtual WebContents* GetOuterWebContents() const = 0;
// Returns the root WebContents of the WebContents tree. Always returns // Returns the root WebContents of the WebContents tree. Always returns
// non-null value. // non-null value.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment