OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/extension_webkit_preferences.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 #include "webkit/glue/webpreferences.h" | 10 #include "webkit/glue/webpreferences.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // memory impact of extensions. See crbug.com/123935. This also "works | 31 // memory impact of extensions. See crbug.com/123935. This also "works |
32 // around" crbug.com/123935 | 32 // around" crbug.com/123935 |
33 if (render_view_type == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { | 33 if (render_view_type == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { |
34 webkit_prefs->force_compositing_mode = false; | 34 webkit_prefs->force_compositing_mode = false; |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 if (extension->is_platform_app()) { | 38 if (extension->is_platform_app()) { |
39 webkit_prefs->databases_enabled = false; | 39 webkit_prefs->databases_enabled = false; |
40 webkit_prefs->local_storage_enabled = false; | 40 webkit_prefs->local_storage_enabled = false; |
| 41 webkit_prefs->sync_xhr_in_documents_enabled = false; |
41 } | 42 } |
42 | 43 |
43 // Enable WebGL features that regular pages can't access, since they add | 44 // Enable WebGL features that regular pages can't access, since they add |
44 // more risk of fingerprinting. | 45 // more risk of fingerprinting. |
45 webkit_prefs->privileged_webgl_extensions_enabled = true; | 46 webkit_prefs->privileged_webgl_extensions_enabled = true; |
46 | 47 |
47 // If this is a component extension, then apply the same poliy for | 48 // If this is a component extension, then apply the same poliy for |
48 // accelerated compositing as for chrome: URLs (from | 49 // accelerated compositing as for chrome: URLs (from |
49 // WebContents::GetWebkitPrefs). This is important for component extensions | 50 // WebContents::GetWebkitPrefs). This is important for component extensions |
50 // like the file manager which are sometimes loaded using chrome: URLs and | 51 // like the file manager which are sometimes loaded using chrome: URLs and |
51 // sometimes loaded with chrome-extension: URLs - we should expect the | 52 // sometimes loaded with chrome-extension: URLs - we should expect the |
52 // performance characteristics to be similar in both cases. | 53 // performance characteristics to be similar in both cases. |
53 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 54 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
54 if (extension->location() == extensions::Extension::COMPONENT && | 55 if (extension->location() == extensions::Extension::COMPONENT && |
55 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { | 56 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { |
56 webkit_prefs->accelerated_compositing_enabled = false; | 57 webkit_prefs->accelerated_compositing_enabled = false; |
57 webkit_prefs->accelerated_2d_canvas_enabled = false; | 58 webkit_prefs->accelerated_2d_canvas_enabled = false; |
58 } | 59 } |
59 } | 60 } |
60 | 61 |
61 } // extension_webkit_preferences | 62 } // extension_webkit_preferences |
OLD | NEW |