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 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1294 ShouldSwapProcessesForRedirect(resource_context, current_url, new_url); | 1294 ShouldSwapProcessesForRedirect(resource_context, current_url, new_url); |
1295 #else | 1295 #else |
1296 return false; | 1296 return false; |
1297 #endif | 1297 #endif |
1298 } | 1298 } |
1299 | 1299 |
1300 bool ChromeContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) { | 1300 bool ChromeContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) { |
1301 return !url.SchemeIs(chrome::kChromeNativeScheme); | 1301 return !url.SchemeIs(chrome::kChromeNativeScheme); |
1302 } | 1302 } |
1303 | 1303 |
1304 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 1304 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
msw
2016/08/23 23:10:55
In a follow-up CL (shouldn't block this CL), it'd
Jinsuk Kim
2016/08/24 08:23:42
Left a TODO for a follow-up.
| |
1305 const std::string& alias_name) { | 1305 const std::string& alias_name) { |
1306 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); | 1306 return ::GetCanonicalEncodingNameByAliasName(alias_name); |
1307 } | 1307 } |
1308 | 1308 |
1309 namespace { | 1309 namespace { |
1310 | 1310 |
1311 bool IsAutoReloadEnabled() { | 1311 bool IsAutoReloadEnabled() { |
1312 // Fetch the field trial, even though we don't use it. Calling FindFullName() | 1312 // Fetch the field trial, even though we don't use it. Calling FindFullName() |
1313 // causes the field-trial mechanism to report which group we're in, which | 1313 // causes the field-trial mechanism to report which group we're in, which |
1314 // might reflect a hard disable or hard enable via flag, both of which have | 1314 // might reflect a hard disable or hard enable via flag, both of which have |
1315 // their own field trial groups. This lets us know what percentage of users | 1315 // their own field trial groups. This lets us know what percentage of users |
1316 // manually enable or disable auto-reload. | 1316 // manually enable or disable auto-reload. |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2365 prefs->GetBoolean(prefs::kWebKitForceEnableZoom); | 2365 prefs->GetBoolean(prefs::kWebKitForceEnableZoom); |
2366 #endif | 2366 #endif |
2367 | 2367 |
2368 #if defined(OS_ANDROID) | 2368 #if defined(OS_ANDROID) |
2369 web_prefs->password_echo_enabled = | 2369 web_prefs->password_echo_enabled = |
2370 prefs->GetBoolean(prefs::kWebKitPasswordEchoEnabled); | 2370 prefs->GetBoolean(prefs::kWebKitPasswordEchoEnabled); |
2371 #else | 2371 #else |
2372 web_prefs->password_echo_enabled = browser_defaults::kPasswordEchoEnabled; | 2372 web_prefs->password_echo_enabled = browser_defaults::kPasswordEchoEnabled; |
2373 #endif | 2373 #endif |
2374 | 2374 |
2375 web_prefs->uses_universal_detector = | 2375 web_prefs->uses_universal_detector = true; // autodetection is always on. |
2376 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); | |
2377 web_prefs->text_areas_are_resizable = | 2376 web_prefs->text_areas_are_resizable = |
2378 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); | 2377 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); |
2379 web_prefs->hyperlink_auditing_enabled = | 2378 web_prefs->hyperlink_auditing_enabled = |
2380 prefs->GetBoolean(prefs::kEnableHyperlinkAuditing); | 2379 prefs->GetBoolean(prefs::kEnableHyperlinkAuditing); |
2381 | 2380 |
2382 #if defined(ENABLE_EXTENSIONS) | 2381 #if defined(ENABLE_EXTENSIONS) |
2383 std::string image_animation_policy = | 2382 std::string image_animation_policy = |
2384 prefs->GetString(prefs::kAnimationPolicy); | 2383 prefs->GetString(prefs::kAnimationPolicy); |
2385 if (image_animation_policy == kAnimationPolicyOnce) | 2384 if (image_animation_policy == kAnimationPolicyOnce) |
2386 web_prefs->animation_policy = | 2385 web_prefs->animation_policy = |
2387 content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE; | 2386 content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE; |
2388 else if (image_animation_policy == kAnimationPolicyNone) | 2387 else if (image_animation_policy == kAnimationPolicyNone) |
2389 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_NO_ANIMATION; | 2388 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_NO_ANIMATION; |
2390 else | 2389 else |
2391 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_ALLOWED; | 2390 web_prefs->animation_policy = content::IMAGE_ANIMATION_POLICY_ALLOWED; |
2392 #endif | 2391 #endif |
2393 | 2392 |
2394 // Make sure we will set the default_encoding with canonical encoding name. | 2393 // Make sure we will set the default_encoding with canonical encoding name. |
2395 web_prefs->default_encoding = | 2394 web_prefs->default_encoding = GetCanonicalEncodingNameByAliasName( |
2396 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | |
2397 web_prefs->default_encoding); | 2395 web_prefs->default_encoding); |
2398 if (web_prefs->default_encoding.empty()) { | 2396 if (web_prefs->default_encoding.empty()) { |
2399 prefs->ClearPref(prefs::kDefaultCharset); | 2397 prefs->ClearPref(prefs::kDefaultCharset); |
2400 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); | 2398 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); |
2401 } | 2399 } |
2402 DCHECK(!web_prefs->default_encoding.empty()); | 2400 DCHECK(!web_prefs->default_encoding.empty()); |
2403 | 2401 |
2404 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2402 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
2405 switches::kEnablePotentiallyAnnoyingSecurityFeatures)) { | 2403 switches::kEnablePotentiallyAnnoyingSecurityFeatures)) { |
2406 web_prefs->disable_reading_from_canvas = true; | 2404 web_prefs->disable_reading_from_canvas = true; |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3057 if (channel <= kMaxDisableEncryptionChannel) { | 3055 if (channel <= kMaxDisableEncryptionChannel) { |
3058 static const char* const kWebRtcDevSwitchNames[] = { | 3056 static const char* const kWebRtcDevSwitchNames[] = { |
3059 switches::kDisableWebRtcEncryption, | 3057 switches::kDisableWebRtcEncryption, |
3060 }; | 3058 }; |
3061 to_command_line->CopySwitchesFrom(from_command_line, | 3059 to_command_line->CopySwitchesFrom(from_command_line, |
3062 kWebRtcDevSwitchNames, | 3060 kWebRtcDevSwitchNames, |
3063 arraysize(kWebRtcDevSwitchNames)); | 3061 arraysize(kWebRtcDevSwitchNames)); |
3064 } | 3062 } |
3065 } | 3063 } |
3066 #endif // defined(ENABLE_WEBRTC) | 3064 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |