blob: 74e3b36634db241d8e3c891e25f8d11ea973deaa [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 fbf6133b8fe8d..f2434b078f7f9 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, getProfile(), 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));
}
/**