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

Unified Diff: chrome/browser/extensions/extension_webkit_preferences.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
Index: chrome/browser/extensions/extension_webkit_preferences.cc
diff --git a/chrome/browser/extensions/extension_webkit_preferences.cc b/chrome/browser/extensions/extension_webkit_preferences.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4be4be7faef99d5718840956ce3c9f279579feff
--- /dev/null
+++ b/chrome/browser/extensions/extension_webkit_preferences.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/glue/webpreferences.h"
+
+#include "chrome/common/extensions/extension.h"
+
+namespace extension_webkit_preferences {
+
+void SetPreferences(WebPreferences* webkit_prefs, const Extension* extension) {
+ if (extension && !extension->is_hosted_app()) {
+ // Extensions are trusted so we override any user preferences for disabling
+ // javascript or images.
+ webkit_prefs->loads_images_automatically = true;
+ webkit_prefs->javascript_enabled = true;
+
+ // Tabs aren't typically allowed to close windows. But extensions shouldn't
+ // be subject to that.
+ webkit_prefs->allow_scripts_to_close_windows = true;
+
+ // Enable privileged WebGL extensions.
+ webkit_prefs->privileged_webgl_extensions_enabled = true;
+ }
+}
+
+} // extension_webkit_preferences
« no previous file with comments | « chrome/browser/extensions/extension_webkit_preferences.h ('k') | chrome/browser/notifications/balloon_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698