From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Micay 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 3d35cb516928f..4689ed7213cd7 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 @@ -109,26 +109,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)); } /**