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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 956313002: ChromeContentRendererClient should not rely on Dispatcher::is_extension_process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing ifdefs Created 5 years, 10 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 | « no previous file | extensions/renderer/dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 5f3b5c47af3f2084d3a1f518656e166a051c6210..bae094a4213b30e87fc8313c3379b14a380c7ad6 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -283,6 +283,12 @@ GURL GetPluginInstancePosterImage(const blink::WebPluginParams& params,
}
#endif
+#if defined(ENABLE_EXTENSIONS)
+bool IsStandaloneExtensionProcess() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ extensions::switches::kExtensionProcess);
+}
+#endif
} // namespace
ChromeContentRendererClient::ChromeContentRendererClient() {
@@ -1160,7 +1166,7 @@ void ChromeContentRendererClient::GetNavigationErrorStrings(
bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {
#if defined(ENABLE_EXTENSIONS)
- return !extension_dispatcher_->is_extension_process();
+ return !IsStandaloneExtensionProcess();
#else
return true;
#endif
@@ -1275,7 +1281,7 @@ bool ChromeContentRendererClient::ShouldFork(WebFrame* frame,
// in a normal process, or if it's a process for an extension that has been
// uninstalled.
if (frame->top()->document().url() == url) {
- if (is_extension_url != extension_dispatcher_->is_extension_process())
+ if (is_extension_url != IsStandaloneExtensionProcess())
return true;
}
#endif // defined(ENABLE_EXTENSIONS)
@@ -1399,7 +1405,7 @@ bool ChromeContentRendererClient::CrossesExtensionExtents(
opener_document.url()) != NULL;
if (!is_extension_url &&
!opener_is_extension_url &&
- extension_dispatcher_->is_extension_process() &&
+ IsStandaloneExtensionProcess() &&
opener.canRequest(WebURL(new_url)))
return false;
« no previous file with comments | « no previous file | extensions/renderer/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698