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

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: Fixed Android build 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2a04043cb7a548d24df64beef9851e908f676f4f 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -9,6 +9,7 @@
#include "base/file_util.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/download/drag_download_util.h"
#include "content/browser/frame_host/interstitial_page_impl.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
@@ -102,9 +103,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 (BrowserPluginGuest::IsGuest(web_contents))
return NULL;
return static_cast<RenderWidgetHostViewAura*>(view);
}
@@ -1067,7 +1070,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 (!BrowserPluginGuest::IsGuest(web_contents_))
window_observer_.reset(new WindowObserver(this));
// delegate_->GetDragDestDelegate() creates a new delegate on every call.
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698