| Index: chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| index 1eb12687fe8659a69cb1d7deb285ff0bbe1187f0..50fc060743d9a711ef3b459e75456ad6aede8e96 100644
|
| --- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| +++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
|
| @@ -7,7 +7,9 @@
|
| #include <set>
|
| #include <string>
|
|
|
| +#include "base/command_line.h"
|
| #include "base/memory/singleton.h"
|
| +#include "base/metrics/field_trial.h"
|
| #include "base/prefs/overlay_user_pref_store.h"
|
| #include "base/prefs/pref_change_registrar.h"
|
| #include "base/prefs/pref_service.h"
|
| @@ -318,6 +320,14 @@ void RegisterLocalizedFontPref(user_prefs::PrefRegistrySyncable* registry,
|
| registry->RegisterIntegerPref(path, val);
|
| }
|
|
|
| +bool IsAutodetectEncodingEnabledByDefault() {
|
| + const std::string group_name = base::FieldTrialList::FindFullName(
|
| + "AutodetectEncoding");
|
| + return base::StartsWith(group_name,
|
| + "Enabled",
|
| + base::CompareCase::INSENSITIVE_ASCII);
|
| +}
|
| +
|
| } // namespace
|
|
|
| // Watching all these settings per tab is slow when a user has a lot of tabs and
|
| @@ -581,9 +591,11 @@ void PrefsTabHelper::RegisterProfilePrefs(
|
| IDS_MINIMUM_FONT_SIZE);
|
| RegisterLocalizedFontPref(registry, prefs::kWebKitMinimumLogicalFontSize,
|
| IDS_MINIMUM_LOGICAL_FONT_SIZE);
|
| + bool uses_universal_detector = IsAutodetectEncodingEnabledByDefault() ||
|
| + l10n_util::GetStringUTF8(IDS_USES_UNIVERSAL_DETECTOR) == "true";
|
| registry->RegisterBooleanPref(
|
| prefs::kWebKitUsesUniversalDetector,
|
| - l10n_util::GetStringUTF8(IDS_USES_UNIVERSAL_DETECTOR) == "true",
|
| + uses_universal_detector,
|
| user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
| registry->RegisterStringPref(
|
| prefs::kStaticEncodings,
|
|
|