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

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

Powered by Google App Engine
This is Rietveld 408576698