Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 291403002: Remove some RenderProcessHost::IsGuest call sites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More call sites removed Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index f87411e41860532598470427737091c51fdb455b..6937008f183f0ffffb6e18a9fa3c49f81450ec8b 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -102,9 +102,11 @@ RenderWidgetHostViewAura* ToRenderWidgetHostViewAura(
RenderWidgetHostView* view) {
if (!view || RenderViewHostFactory::has_factory())
return NULL; // Can't cast to RenderWidgetHostViewAura in unit tests.
- RenderProcessHostImpl* process = static_cast<RenderProcessHostImpl*>(
- view->GetRenderWidgetHost()->GetProcess());
- if (process->IsGuest())
+
+ RenderViewHost* rvh = RenderViewHost::From(view->GetRenderWidgetHost());
+ WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
+ rvh ? WebContents::FromRenderViewHost(rvh) : NULL);
+ if (web_contents && !!web_contents->GetBrowserPluginGuest())
return NULL;
return static_cast<RenderWidgetHostViewAura*>(view);
}
@@ -1067,7 +1069,7 @@ void WebContentsViewAura::CreateView(
// The use cases for WindowObserver do not apply to Browser Plugins:
// 1) guests do not support NPAPI plugins.
// 2) guests' window bounds are supposed to come from its embedder.
- if (!web_contents_->GetRenderProcessHost()->IsGuest())
+ if (!web_contents_->GetBrowserPluginGuest())
window_observer_.reset(new WindowObserver(this));
// delegate_->GetDragDestDelegate() creates a new delegate on every call.

Powered by Google App Engine
This is Rietveld 408576698