OLD | NEW |
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/tab_contents/render_view_host_delegate_helper.h" | 5 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 web_prefs.accelerated_layers_enabled = | 302 web_prefs.accelerated_layers_enabled = |
303 !command_line.HasSwitch(switches::kDisableAcceleratedLayers); | 303 !command_line.HasSwitch(switches::kDisableAcceleratedLayers); |
304 web_prefs.composite_to_texture_enabled = | 304 web_prefs.composite_to_texture_enabled = |
305 command_line.HasSwitch(switches::kEnableCompositeToTexture); | 305 command_line.HasSwitch(switches::kEnableCompositeToTexture); |
306 web_prefs.accelerated_plugins_enabled = | 306 web_prefs.accelerated_plugins_enabled = |
307 command_line.HasSwitch(switches::kEnableAcceleratedPlugins); | 307 command_line.HasSwitch(switches::kEnableAcceleratedPlugins); |
308 web_prefs.accelerated_video_enabled = | 308 web_prefs.accelerated_video_enabled = |
309 !command_line.HasSwitch(switches::kDisableAcceleratedVideo); | 309 !command_line.HasSwitch(switches::kDisableAcceleratedVideo); |
310 web_prefs.memory_info_enabled = | 310 web_prefs.memory_info_enabled = |
311 command_line.HasSwitch(switches::kEnableMemoryInfo); | 311 command_line.HasSwitch(switches::kEnableMemoryInfo); |
312 web_prefs.hyperlink_auditing_enabled = | |
313 !command_line.HasSwitch(switches::kNoPings); | |
314 web_prefs.interactive_form_validation_enabled = | 312 web_prefs.interactive_form_validation_enabled = |
315 !command_line.HasSwitch(switches::kDisableInteractiveFormValidation); | 313 !command_line.HasSwitch(switches::kDisableInteractiveFormValidation); |
316 web_prefs.fullscreen_enabled = | 314 web_prefs.fullscreen_enabled = |
317 command_line.HasSwitch(switches::kEnableFullScreen); | 315 command_line.HasSwitch(switches::kEnableFullScreen); |
318 | 316 |
319 // The user stylesheet watcher may not exist in a testing profile. | 317 // The user stylesheet watcher may not exist in a testing profile. |
320 if (profile->GetUserStyleSheetWatcher()) { | 318 if (profile->GetUserStyleSheetWatcher()) { |
321 web_prefs.user_style_sheet_enabled = true; | 319 web_prefs.user_style_sheet_enabled = true; |
322 web_prefs.user_style_sheet_location = | 320 web_prefs.user_style_sheet_location = |
323 profile->GetUserStyleSheetWatcher()->user_style_sheet(); | 321 profile->GetUserStyleSheetWatcher()->user_style_sheet(); |
(...skipping 11 matching lines...) Expand all Loading... |
335 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureWebgl) | 333 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureWebgl) |
336 web_prefs.experimental_webgl_enabled = false; | 334 web_prefs.experimental_webgl_enabled = false; |
337 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureMultisampling) | 335 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureMultisampling) |
338 web_prefs.gl_multisampling_enabled = false; | 336 web_prefs.gl_multisampling_enabled = false; |
339 } | 337 } |
340 | 338 |
341 web_prefs.uses_universal_detector = | 339 web_prefs.uses_universal_detector = |
342 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); | 340 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); |
343 web_prefs.text_areas_are_resizable = | 341 web_prefs.text_areas_are_resizable = |
344 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); | 342 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); |
| 343 web_prefs.hyperlink_auditing_enabled = |
| 344 prefs->GetBoolean(prefs::kEnableHyperlinkAuditing); |
345 | 345 |
346 // Make sure we will set the default_encoding with canonical encoding name. | 346 // Make sure we will set the default_encoding with canonical encoding name. |
347 web_prefs.default_encoding = | 347 web_prefs.default_encoding = |
348 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | 348 CharacterEncoding::GetCanonicalEncodingNameByAliasName( |
349 web_prefs.default_encoding); | 349 web_prefs.default_encoding); |
350 if (web_prefs.default_encoding.empty()) { | 350 if (web_prefs.default_encoding.empty()) { |
351 prefs->ClearPref(prefs::kDefaultCharset); | 351 prefs->ClearPref(prefs::kDefaultCharset); |
352 web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset); | 352 web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset); |
353 } | 353 } |
354 DCHECK(!web_prefs.default_encoding.empty()); | 354 DCHECK(!web_prefs.default_encoding.empty()); |
(...skipping 14 matching lines...) Expand all Loading... |
369 inspector_settings->SetWithoutPathExpansion(key, | 369 inspector_settings->SetWithoutPathExpansion(key, |
370 Value::CreateStringValue(value)); | 370 Value::CreateStringValue(value)); |
371 } | 371 } |
372 | 372 |
373 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { | 373 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { |
374 DictionaryValue* inspector_settings = | 374 DictionaryValue* inspector_settings = |
375 profile->GetPrefs()->GetMutableDictionary( | 375 profile->GetPrefs()->GetMutableDictionary( |
376 prefs::kWebKitInspectorSettings); | 376 prefs::kWebKitInspectorSettings); |
377 inspector_settings->Clear(); | 377 inspector_settings->Clear(); |
378 } | 378 } |
OLD | NEW |