OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 return false; | 1332 return false; |
1333 #endif | 1333 #endif |
1334 } | 1334 } |
1335 | 1335 |
1336 bool ChromeContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) { | 1336 bool ChromeContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) { |
1337 return !url.SchemeIs(chrome::kChromeNativeScheme); | 1337 return !url.SchemeIs(chrome::kChromeNativeScheme); |
1338 } | 1338 } |
1339 | 1339 |
1340 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 1340 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
1341 const std::string& alias_name) { | 1341 const std::string& alias_name) { |
1342 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); | 1342 return ::GetCanonicalEncodingNameByAliasName(alias_name); |
1343 } | 1343 } |
1344 | 1344 |
1345 namespace { | 1345 namespace { |
1346 | 1346 |
1347 bool IsAutoReloadEnabled() { | 1347 bool IsAutoReloadEnabled() { |
1348 // Fetch the field trial, even though we don't use it. Calling FindFullName() | 1348 // Fetch the field trial, even though we don't use it. Calling FindFullName() |
1349 // causes the field-trial mechanism to report which group we're in, which | 1349 // causes the field-trial mechanism to report which group we're in, which |
1350 // might reflect a hard disable or hard enable via flag, both of which have | 1350 // might reflect a hard disable or hard enable via flag, both of which have |
1351 // their own field trial groups. This lets us know what percentage of users | 1351 // their own field trial groups. This lets us know what percentage of users |
1352 // manually enable or disable auto-reload. | 1352 // manually enable or disable auto-reload. |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2405 prefs->GetBoolean(prefs::kWebKitForceEnableZoom); | 2405 prefs->GetBoolean(prefs::kWebKitForceEnableZoom); |
2406 #endif | 2406 #endif |
2407 | 2407 |
2408 #if defined(OS_ANDROID) | 2408 #if defined(OS_ANDROID) |
2409 web_prefs->password_echo_enabled = | 2409 web_prefs->password_echo_enabled = |
2410 prefs->GetBoolean(prefs::kWebKitPasswordEchoEnabled); | 2410 prefs->GetBoolean(prefs::kWebKitPasswordEchoEnabled); |
2411 #else | 2411 #else |
2412 web_prefs->password_echo_enabled = browser_defaults::kPasswordEchoEnabled; | 2412 web_prefs->password_echo_enabled = browser_defaults::kPasswordEchoEnabled; |
2413 #endif | 2413 #endif |
2414 | 2414 |
2415 web_prefs->uses_universal_detector = | 2415 web_prefs->uses_universal_detector = true; // autodetection is always on. |
2416 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); | |
2417 web_prefs->text_areas_are_resizable = | 2416 web_prefs->text_areas_are_resizable = |
2418 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); | 2417 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); |
2419 web_prefs->hyperlink_auditing_enabled = | 2418 web_prefs->hyperlink_auditing_enabled = |
2420 prefs->GetBoolean(prefs::kEnableHyperlinkAuditing); | 2419 prefs->GetBoolean(prefs::kEnableHyperlinkAuditing); |
2421 | 2420 |
2422 #if defined(ENABLE_EXTENSIONS) | 2421 #if defined(ENABLE_EXTENSIONS) |
2423 std::string image_animation_policy = | 2422 std::string image_animation_policy = |
2424 prefs->GetString(prefs::kAnimationPolicy); | 2423 prefs->GetString(prefs::kAnimationPolicy); |
2425 if (image_animation_policy == kAnimationPolicyOnce) | 2424 if (image_animation_policy == kAnimationPolicyOnce) |
2426 web_prefs->animation_policy = | 2425 web_prefs->animation_policy = |
2427 content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE; | 2426 content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE; |
2428 else if (image_animation_policy == kAnimationPolicyNone) | 2427 else if (image_animation_policy == kAnimationPolicyNone) |
2429 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_NO_ANIMATION; | 2428 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_NO_ANIMATION; |
2430 else | 2429 else |
2431 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_ALLOWED; | 2430 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_ALLOWED; |
2432 #endif | 2431 #endif |
2433 | 2432 |
2434 // Make sure we will set the default_encoding with canonical encoding name. | 2433 // Make sure we will set the default_encoding with canonical encoding name. |
2435 web_prefs->default_encoding = | 2434 web_prefs->default_encoding = GetCanonicalEncodingNameByAliasName( |
2436 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | |
2437 web_prefs->default_encoding); | 2435 web_prefs->default_encoding); |
2438 if (web_prefs->default_encoding.empty()) { | 2436 if (web_prefs->default_encoding.empty()) { |
2439 prefs->ClearPref(prefs::kDefaultCharset); | 2437 prefs->ClearPref(prefs::kDefaultCharset); |
2440 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); | 2438 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); |
2441 } | 2439 } |
2442 DCHECK(!web_prefs->default_encoding.empty()); | 2440 DCHECK(!web_prefs->default_encoding.empty()); |
2443 | 2441 |
2444 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2442 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
2445 switches::kEnablePotentiallyAnnoyingSecurityFeatures)) { | 2443 switches::kEnablePotentiallyAnnoyingSecurityFeatures)) { |
2446 web_prefs->disable_reading_from_canvas = true; | 2444 web_prefs->disable_reading_from_canvas = true; |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3159 if (channel <= kMaxDisableEncryptionChannel) { | 3157 if (channel <= kMaxDisableEncryptionChannel) { |
3160 static const char* const kWebRtcDevSwitchNames[] = { | 3158 static const char* const kWebRtcDevSwitchNames[] = { |
3161 switches::kDisableWebRtcEncryption, | 3159 switches::kDisableWebRtcEncryption, |
3162 }; | 3160 }; |
3163 to_command_line->CopySwitchesFrom(from_command_line, | 3161 to_command_line->CopySwitchesFrom(from_command_line, |
3164 kWebRtcDevSwitchNames, | 3162 kWebRtcDevSwitchNames, |
3165 arraysize(kWebRtcDevSwitchNames)); | 3163 arraysize(kWebRtcDevSwitchNames)); |
3166 } | 3164 } |
3167 } | 3165 } |
3168 #endif // defined(ENABLE_WEBRTC) | 3166 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |