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

Unified Diff: chrome/browser/tab_contents/render_view_host_delegate_helper.cc

Issue 8403024: Set extension-related webkit preferences in a common location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove is_web_ui param Created 9 years, 2 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 | « chrome/browser/tab_contents/render_view_host_delegate_helper.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_host_delegate_helper.cc
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index d2e9bce2e78fc0084e56644320aaa52359b8417a..d1c3c1f3fc21fec5636cc8e811094fd873f12cfe 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -13,7 +13,9 @@
#include "chrome/browser/background/background_contents_service_factory.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/character_encoding.h"
+#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_webkit_preferences.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/prerender/prerender_manager.h"
@@ -23,6 +25,7 @@
#include "chrome/browser/user_style_sheet_watcher.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
+#include "content/browser/child_process_security_policy.h"
#include "content/browser/gpu/gpu_data_manager.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
@@ -326,8 +329,9 @@ RenderWidgetHostView*
// static
WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
- content::BrowserContext* browser_context, bool is_web_ui) {
- Profile* profile = Profile::FromBrowserContext(browser_context);
+ RenderViewHost* rvh) {
+ Profile* profile = Profile::FromBrowserContext(
+ rvh->process()->browser_context());
PrefService* prefs = profile->GetPrefs();
WebPreferences web_prefs;
@@ -525,13 +529,23 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
}
DCHECK(!web_prefs.default_encoding.empty());
- if (is_web_ui) {
+ if (ChildProcessSecurityPolicy::GetInstance()->HasWebUIBindings(
+ rvh->process()->id())) {
web_prefs.loads_images_automatically = true;
web_prefs.javascript_enabled = true;
}
web_prefs.is_online = !net::NetworkChangeNotifier::IsOffline();
+ ExtensionProcessManager* extension_process_manager =
+ profile->GetExtensionProcessManager();
+ if (extension_process_manager) {
+ const Extension* extension =
+ extension_process_manager->GetExtensionForSiteInstance(
+ rvh->site_instance()->id());
+ extension_webkit_preferences::SetPreferences(&web_prefs, extension);
+ }
+
return web_prefs;
}
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_delegate_helper.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698