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

Side by Side Diff: chrome/browser/tab_contents/render_view_host_delegate_helper.cc

Issue 6773006: Add enableReferrers and enableHyperlinkAuditing to contentSettings.misc API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/renderer_preferences_util.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 web_prefs.accelerated_layers_enabled = 306 web_prefs.accelerated_layers_enabled =
307 !command_line.HasSwitch(switches::kDisableAcceleratedLayers); 307 !command_line.HasSwitch(switches::kDisableAcceleratedLayers);
308 web_prefs.composite_to_texture_enabled = 308 web_prefs.composite_to_texture_enabled =
309 command_line.HasSwitch(switches::kEnableCompositeToTexture); 309 command_line.HasSwitch(switches::kEnableCompositeToTexture);
310 web_prefs.accelerated_plugins_enabled = 310 web_prefs.accelerated_plugins_enabled =
311 command_line.HasSwitch(switches::kEnableAcceleratedPlugins); 311 command_line.HasSwitch(switches::kEnableAcceleratedPlugins);
312 web_prefs.accelerated_video_enabled = 312 web_prefs.accelerated_video_enabled =
313 !command_line.HasSwitch(switches::kDisableAcceleratedVideo); 313 !command_line.HasSwitch(switches::kDisableAcceleratedVideo);
314 web_prefs.memory_info_enabled = 314 web_prefs.memory_info_enabled =
315 command_line.HasSwitch(switches::kEnableMemoryInfo); 315 command_line.HasSwitch(switches::kEnableMemoryInfo);
316 web_prefs.hyperlink_auditing_enabled =
317 !command_line.HasSwitch(switches::kNoPings);
318 web_prefs.interactive_form_validation_enabled = 316 web_prefs.interactive_form_validation_enabled =
319 !command_line.HasSwitch(switches::kDisableInteractiveFormValidation); 317 !command_line.HasSwitch(switches::kDisableInteractiveFormValidation);
320 web_prefs.fullscreen_enabled = 318 web_prefs.fullscreen_enabled =
321 command_line.HasSwitch(switches::kEnableFullScreen); 319 command_line.HasSwitch(switches::kEnableFullScreen);
322 320
323 // The user stylesheet watcher may not exist in a testing profile. 321 // The user stylesheet watcher may not exist in a testing profile.
324 if (profile->GetUserStyleSheetWatcher()) { 322 if (profile->GetUserStyleSheetWatcher()) {
325 web_prefs.user_style_sheet_enabled = true; 323 web_prefs.user_style_sheet_enabled = true;
326 web_prefs.user_style_sheet_location = 324 web_prefs.user_style_sheet_location =
327 profile->GetUserStyleSheetWatcher()->user_style_sheet(); 325 profile->GetUserStyleSheetWatcher()->user_style_sheet();
(...skipping 11 matching lines...) Expand all
339 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureWebgl) 337 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureWebgl)
340 web_prefs.experimental_webgl_enabled = false; 338 web_prefs.experimental_webgl_enabled = false;
341 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureMultisampling) 339 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureMultisampling)
342 web_prefs.gl_multisampling_enabled = false; 340 web_prefs.gl_multisampling_enabled = false;
343 } 341 }
344 342
345 web_prefs.uses_universal_detector = 343 web_prefs.uses_universal_detector =
346 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); 344 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector);
347 web_prefs.text_areas_are_resizable = 345 web_prefs.text_areas_are_resizable =
348 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); 346 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable);
347 web_prefs.hyperlink_auditing_enabled =
348 prefs->GetBoolean(prefs::kEnableHyperlinkAuditing);
349 349
350 // Make sure we will set the default_encoding with canonical encoding name. 350 // Make sure we will set the default_encoding with canonical encoding name.
351 web_prefs.default_encoding = 351 web_prefs.default_encoding =
352 CharacterEncoding::GetCanonicalEncodingNameByAliasName( 352 CharacterEncoding::GetCanonicalEncodingNameByAliasName(
353 web_prefs.default_encoding); 353 web_prefs.default_encoding);
354 if (web_prefs.default_encoding.empty()) { 354 if (web_prefs.default_encoding.empty()) {
355 prefs->ClearPref(prefs::kDefaultCharset); 355 prefs->ClearPref(prefs::kDefaultCharset);
356 web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset); 356 web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset);
357 } 357 }
358 DCHECK(!web_prefs.default_encoding.empty()); 358 DCHECK(!web_prefs.default_encoding.empty());
(...skipping 11 matching lines...) Expand all
370 DictionaryPrefUpdate update(profile->GetPrefs(), 370 DictionaryPrefUpdate update(profile->GetPrefs(),
371 prefs::kWebKitInspectorSettings); 371 prefs::kWebKitInspectorSettings);
372 DictionaryValue* inspector_settings = update.Get(); 372 DictionaryValue* inspector_settings = update.Get();
373 inspector_settings->SetWithoutPathExpansion(key, 373 inspector_settings->SetWithoutPathExpansion(key,
374 Value::CreateStringValue(value)); 374 Value::CreateStringValue(value));
375 } 375 }
376 376
377 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { 377 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) {
378 profile->GetPrefs()->ClearPref(prefs::kWebKitInspectorSettings); 378 profile->GetPrefs()->ClearPref(prefs::kWebKitInspectorSettings);
379 } 379 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_preferences_util.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698