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..3dd5baa718119099d86ae7df2c20c4ca1a58b01b 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 IsAutodetectEncodingEnabled() { |
battre
2015/12/02 13:08:26
nit: Should this be IsAutodetectEncodingEnabledByD
Jinsuk Kim
2015/12/02 23:14:38
Done.
|
+ 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 = IsAutodetectEncodingEnabled() ? |
+ true : l10n_util::GetStringUTF8(IDS_USES_UNIVERSAL_DETECTOR) == "true"; |
battre
2015/12/02 13:08:26
... = IsAutodetectEncodingEnabled() || l10n_util::
Jinsuk Kim
2015/12/02 23:14:38
Done.
|
registry->RegisterBooleanPref( |
prefs::kWebKitUsesUniversalDetector, |
- l10n_util::GetStringUTF8(IDS_USES_UNIVERSAL_DETECTOR) == "true", |
+ uses_universal_detector, |
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
registry->RegisterStringPref( |
prefs::kStaticEncodings, |