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

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

Powered by Google App Engine
This is Rietveld 408576698