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

Side by Side Diff: chrome/browser/extensions/extension_webkit_preferences.cc

Issue 8520036: Revert 110262 - Have ExtensionHost use TabContents instead of RenderViewHost. Try #2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_webkit_preferences.h" 5 #include "webkit/glue/webpreferences.h"
6 6
7 #include "chrome/common/extensions/extension.h" 7 #include "chrome/common/extensions/extension.h"
8 #include "webkit/glue/webpreferences.h"
9 8
10 namespace extension_webkit_preferences { 9 namespace extension_webkit_preferences {
11 10
12 void SetPreferences(const Extension* extension, 11 void SetPreferences(WebPreferences* webkit_prefs, const Extension* extension) {
13 content::ViewType render_view_type,
14 WebPreferences* webkit_prefs) {
15 if (extension && !extension->is_hosted_app()) { 12 if (extension && !extension->is_hosted_app()) {
16 // Extensions are trusted so we override any user preferences for disabling 13 // Extensions are trusted so we override any user preferences for disabling
17 // javascript or images. 14 // javascript or images.
18 webkit_prefs->loads_images_automatically = true; 15 webkit_prefs->loads_images_automatically = true;
19 webkit_prefs->javascript_enabled = true; 16 webkit_prefs->javascript_enabled = true;
20 17
21 // Tabs aren't typically allowed to close windows. But extensions shouldn't 18 // Tabs aren't typically allowed to close windows. But extensions shouldn't
22 // be subject to that. 19 // be subject to that.
23 webkit_prefs->allow_scripts_to_close_windows = true; 20 webkit_prefs->allow_scripts_to_close_windows = true;
24 21
25 // Enable privileged WebGL extensions. 22 // Enable privileged WebGL extensions.
26 webkit_prefs->privileged_webgl_extensions_enabled = true; 23 webkit_prefs->privileged_webgl_extensions_enabled = true;
27
28 // Disable anything that requires the GPU process for background pages.
29 // See http://crbug.com/64512 and http://crbug.com/64841.
30 if (render_view_type == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
31 webkit_prefs->experimental_webgl_enabled = false;
32 webkit_prefs->accelerated_compositing_enabled = false;
33 webkit_prefs->accelerated_2d_canvas_enabled = false;
34 }
35 } 24 }
36 } 25 }
37 26
38 } // extension_webkit_preferences 27 } // extension_webkit_preferences
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_webkit_preferences.h ('k') | chrome/browser/extensions/extension_webnavigation_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698