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 | 26 +------------------ 1 file changed, 1 insertion(+), 25 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 b2080530c62ca..9afebfe5060d8 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 @@ -99,31 +99,7 @@ public class LanguageSettings extends ChromeBaseSettingsFragment (ContentLanguagesPreference) findPreference(PREFERRED_LANGUAGES_KEY); mLanguageListPref.initialize(this, getPrefService()); - 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(new ChromeManagedPreferenceDelegate( - getProfile()) { - @Override - public boolean isPreferenceControlledByPolicy(Preference preference) { - return getPrefService().isManagedPreference(Pref.OFFER_TRANSLATE_ENABLED); - } - }); + getPreferenceScreen().removePreference(findPreference(TRANSLATE_SWITCH_KEY)); } /**