blob: 39abf4b8e7fad90409e2e039d54401562e921124 [file] [log] [blame]
From 0000000000000000000000000000000000000000 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 | 29 +------------------
1 file changed, 1 insertion(+), 28 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 0b4da85180efb..2e0540d8cccd4 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
@@ -97,34 +97,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));
}
/**