| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/render_view_host_delegate_helper.h" | 5 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 web_prefs.xss_auditor_enabled = | 268 web_prefs.xss_auditor_enabled = |
| 269 command_line.HasSwitch(switches::kEnableXSSAuditor); | 269 command_line.HasSwitch(switches::kEnableXSSAuditor); |
| 270 web_prefs.application_cache_enabled = | 270 web_prefs.application_cache_enabled = |
| 271 !command_line.HasSwitch(switches::kDisableApplicationCache); | 271 !command_line.HasSwitch(switches::kDisableApplicationCache); |
| 272 | 272 |
| 273 web_prefs.local_storage_enabled = | 273 web_prefs.local_storage_enabled = |
| 274 !command_line.HasSwitch(switches::kDisableLocalStorage); | 274 !command_line.HasSwitch(switches::kDisableLocalStorage); |
| 275 web_prefs.databases_enabled = | 275 web_prefs.databases_enabled = |
| 276 !command_line.HasSwitch(switches::kDisableDatabases); | 276 !command_line.HasSwitch(switches::kDisableDatabases); |
| 277 web_prefs.experimental_webgl_enabled = | 277 web_prefs.experimental_webgl_enabled = |
| 278 !command_line.HasSwitch(switches::kDisableExperimentalWebGL); | 278 command_line.HasSwitch(switches::kEnableExperimentalWebGL); |
| 279 web_prefs.site_specific_quirks_enabled = | 279 web_prefs.site_specific_quirks_enabled = |
| 280 !command_line.HasSwitch(switches::kDisableSiteSpecificQuirks); | 280 !command_line.HasSwitch(switches::kDisableSiteSpecificQuirks); |
| 281 web_prefs.allow_file_access_from_file_urls = | 281 web_prefs.allow_file_access_from_file_urls = |
| 282 command_line.HasSwitch(switches::kAllowFileAccessFromFiles); | 282 command_line.HasSwitch(switches::kAllowFileAccessFromFiles); |
| 283 web_prefs.show_composited_layer_borders = | 283 web_prefs.show_composited_layer_borders = |
| 284 command_line.HasSwitch(switches::kShowCompositedLayerBorders); | 284 command_line.HasSwitch(switches::kShowCompositedLayerBorders); |
| 285 web_prefs.accelerated_compositing_enabled = | 285 web_prefs.accelerated_compositing_enabled = |
| 286 !command_line.HasSwitch(switches::kDisableAcceleratedCompositing); | 286 command_line.HasSwitch(switches::kEnableAcceleratedCompositing); |
| 287 web_prefs.accelerated_2d_canvas_enabled = | 287 web_prefs.accelerated_2d_canvas_enabled = |
| 288 command_line.HasSwitch(switches::kEnableAccelerated2dCanvas); | 288 command_line.HasSwitch(switches::kEnableAccelerated2dCanvas); |
| 289 web_prefs.memory_info_enabled = | 289 web_prefs.memory_info_enabled = |
| 290 command_line.HasSwitch(switches::kEnableMemoryInfo); | 290 command_line.HasSwitch(switches::kEnableMemoryInfo); |
| 291 // The user stylesheet watcher may not exist in a testing profile. | 291 // The user stylesheet watcher may not exist in a testing profile. |
| 292 if (profile->GetUserStyleSheetWatcher()) { | 292 if (profile->GetUserStyleSheetWatcher()) { |
| 293 web_prefs.user_style_sheet_enabled = true; | 293 web_prefs.user_style_sheet_enabled = true; |
| 294 web_prefs.user_style_sheet_location = | 294 web_prefs.user_style_sheet_location = |
| 295 profile->GetUserStyleSheetWatcher()->user_style_sheet(); | 295 profile->GetUserStyleSheetWatcher()->user_style_sheet(); |
| 296 } else { | 296 } else { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 313 } | 313 } |
| 314 DCHECK(!web_prefs.default_encoding.empty()); | 314 DCHECK(!web_prefs.default_encoding.empty()); |
| 315 | 315 |
| 316 if (is_dom_ui) { | 316 if (is_dom_ui) { |
| 317 web_prefs.loads_images_automatically = true; | 317 web_prefs.loads_images_automatically = true; |
| 318 web_prefs.javascript_enabled = true; | 318 web_prefs.javascript_enabled = true; |
| 319 } | 319 } |
| 320 | 320 |
| 321 return web_prefs; | 321 return web_prefs; |
| 322 } | 322 } |
| OLD | NEW |