| From 46ca75ac42e01b954f3051bb0f7eec8dde815636 Mon Sep 17 00:00:00 2001 |
| From: Daniel Micay <danielmicay@gmail.com> |
| Date: Fri, 2 Aug 2019 21:11:17 -0400 |
| Subject: [PATCH] remove translate offer preference |
| |
| --- |
| .../language/settings/LanguageSettings.java | 21 +------------------ |
| 1 file changed, 1 insertion(+), 20 deletions(-) |
| |
| diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java |
| index 2c8af6ded3ed0..4b45cb935d198 100644 |
| --- a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java |
| +++ b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java |
| @@ -101,26 +101,7 @@ public class LanguageSettings extends PreferenceFragmentCompat |
| (ContentLanguagesPreference) findPreference(PREFERRED_LANGUAGES_KEY); |
| mLanguageListPref.registerActivityLauncher(this); |
| |
| - ChromeSwitchPreference translateSwitch = |
| - (ChromeSwitchPreference) findPreference(TRANSLATE_SWITCH_KEY); |
| - boolean isTranslateEnabled = getPrefService().getBoolean(Pref.OFFER_TRANSLATE_ENABLED); |
| - translateSwitch.setChecked(isTranslateEnabled); |
| - |
| - translateSwitch.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { |
| - @Override |
| - public boolean onPreferenceChange(Preference preference, Object newValue) { |
| - boolean enabled = (boolean) newValue; |
| - getPrefService().setBoolean(Pref.OFFER_TRANSLATE_ENABLED, enabled); |
| - mLanguageListPref.notifyPrefChanged(); |
| - LanguagesManager.recordAction(enabled ? LanguagesManager.LanguageSettingsActionType |
| - .ENABLE_TRANSLATE_GLOBALLY |
| - : LanguagesManager.LanguageSettingsActionType |
| - .DISABLE_TRANSLATE_GLOBALLY); |
| - return true; |
| - } |
| - }); |
| - translateSwitch.setManagedPreferenceDelegate((ChromeManagedPreferenceDelegate) preference |
| - -> getPrefService().isManagedPreference(Pref.OFFER_TRANSLATE_ENABLED)); |
| + getPreferenceScreen().removePreference(findPreference(TRANSLATE_SWITCH_KEY)); |
| } |
| |
| /** |