From 98bf922150a1ba5fe248735b377deca3dbb62043 Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Thu, 11 Oct 2018 23:34:52 -0400 Subject: Issue #832 Part 1: Remove modules, chrome, and preferences. --- application/basilisk/app/profile/basilisk.js | 7 - application/basilisk/base/content/browser.css | 5 - application/basilisk/base/content/browser.js | 12 - application/basilisk/base/content/browser.xul | 4 - application/basilisk/base/content/tab-content.js | 7 - .../components/preferences/in-content/content.js | 31 - .../components/preferences/in-content/content.xul | 24 - application/basilisk/components/preferences/jar.mn | 2 - .../basilisk/components/preferences/translation.js | 255 -------- .../components/preferences/translation.xul | 88 --- .../components/translation/BingTranslator.jsm | 449 -------------- .../components/translation/Translation.jsm | 446 -------------- .../translation/TranslationContentHandler.jsm | 181 ------ .../components/translation/TranslationDocument.jsm | 683 --------------------- .../components/translation/YandexTranslator.jsm | 343 ----------- application/basilisk/components/translation/jar.mn | 6 - .../microsoft-translator-attribution.png | Bin 3422 -> 0 bytes .../basilisk/components/translation/moz.build | 7 - .../components/translation/translation-infobar.xml | 441 ------------- 19 files changed, 2991 deletions(-) delete mode 100644 application/basilisk/components/preferences/translation.js delete mode 100644 application/basilisk/components/preferences/translation.xul delete mode 100644 application/basilisk/components/translation/BingTranslator.jsm delete mode 100644 application/basilisk/components/translation/Translation.jsm delete mode 100644 application/basilisk/components/translation/TranslationContentHandler.jsm delete mode 100644 application/basilisk/components/translation/TranslationDocument.jsm delete mode 100644 application/basilisk/components/translation/YandexTranslator.jsm delete mode 100644 application/basilisk/components/translation/jar.mn delete mode 100644 application/basilisk/components/translation/microsoft-translator-attribution.png delete mode 100644 application/basilisk/components/translation/translation-infobar.xml (limited to 'application') diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index fd81e8204..eeec29eb9 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -1266,13 +1266,6 @@ pref("media.gmp-widevinecdm.enabled", true); // -1 means no experiment is run and we use the preferred value for frecency (6h) pref("browser.cache.frecency_experiment", 0); -pref("browser.translation.detectLanguage", false); -pref("browser.translation.neverForLanguages", ""); -// Show the translation UI bits, like the info bar, notification icon and preferences. -pref("browser.translation.ui.show", false); -// Allows to define the translation engine. Bing is default, Yandex may optionally switched on. -pref("browser.translation.engine", "bing"); - // Telemetry settings. // Determines if Telemetry pings can be archived locally. pref("toolkit.telemetry.archive.enabled", true); diff --git a/application/basilisk/base/content/browser.css b/application/basilisk/base/content/browser.css index e951985dc..517c1c5eb 100644 --- a/application/basilisk/base/content/browser.css +++ b/application/basilisk/base/content/browser.css @@ -933,11 +933,6 @@ html|*#gcli-output-frame, transition: none; } -/* Translation */ -notification[value="translation"] { - -moz-binding: url("chrome://browser/content/translation-infobar.xml#translationbar"); -} - /** See bug 872317 for why the following rule is necessary. */ #downloads-button { diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index 4f4ebb08f..d45956191 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -45,7 +45,6 @@ Cu.import("resource://gre/modules/NotificationDB.jsm"); ["SitePermissions", "resource:///modules/SitePermissions.jsm"], ["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"], ["Task", "resource://gre/modules/Task.jsm"], - ["Translation", "resource:///modules/translation/Translation.jsm"], ["UpdateUtils", "resource://gre/modules/UpdateUtils.jsm"], ["Weave", "resource://services-sync/main.js"], ["fxAccounts", "resource://gre/modules/FxAccounts.jsm"], @@ -969,7 +968,6 @@ var gBrowserInit = { // the listener is registered. DOMLinkHandler.init(); gPageStyleMenu.init(); - LanguageDetectionListener.init(); BrowserOnClick.init(); FeedHandler.init(); DevEdition.init(); @@ -5680,16 +5678,6 @@ function setStyleDisabled(disabled) { gPageStyleMenu.disableStyle(); } - -var LanguageDetectionListener = { - init: function() { - window.messageManager.addMessageListener("Translation:DocumentState", msg => { - Translation.documentStateReceived(msg.target, msg.data); - }); - } -}; - - var BrowserOffline = { _inited: false, diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul index 74a90f5e0..3208538c1 100644 --- a/application/basilisk/base/content/browser.xul +++ b/application/basilisk/base/content/browser.xul @@ -675,10 +675,6 @@ tooltiptext="&urlbar.webRTCShareScreenNotificationAnchor.tooltip;"/> - - diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js index 11a9fabce..6d053dd2b 100644 --- a/application/basilisk/base/content/tab-content.js +++ b/application/basilisk/base/content/tab-content.js @@ -558,13 +558,6 @@ var PageStyleHandler = { }; PageStyleHandler.init(); -// Keep a reference to the translation content handler to avoid it it being GC'ed. -var trHandler = null; -if (Services.prefs.getBoolPref("browser.translation.detectLanguage")) { - Cu.import("resource:///modules/translation/TranslationContentHandler.jsm"); - trHandler = new TranslationContentHandler(global, docShell); -} - function gKeywordURIFixup(fixupInfo) { fixupInfo.QueryInterface(Ci.nsIURIFixupInfo); if (!fixupInfo.consumer) { diff --git a/application/basilisk/components/preferences/in-content/content.js b/application/basilisk/components/preferences/in-content/content.js index a957b1dd5..2eac10ca4 100644 --- a/application/basilisk/components/preferences/in-content/content.js +++ b/application/basilisk/components/preferences/in-content/content.js @@ -31,18 +31,6 @@ var gContentPane = { menulist.value = FontBuilder.readFontSelection(menulist); } - // Show translation preferences if we may: - const prefName = "browser.translation.ui.show"; - if (Services.prefs.getBoolPref(prefName)) { - let row = document.getElementById("translationBox"); - row.removeAttribute("hidden"); - // Showing attribution only for Bing Translator. - Components.utils.import("resource:///modules/translation/Translation.jsm"); - if (Translation.translationEngine == "bing") { - document.getElementById("bingAttribution").removeAttribute("hidden"); - } - } - if (AlertsServiceDND) { let notificationsDoNotDisturbRow = document.getElementById("notificationsDoNotDisturbRow"); @@ -66,10 +54,6 @@ var gContentPane = { gContentPane.configureColors); setEventListener("chooseLanguage", "command", gContentPane.showLanguages); - setEventListener("translationAttributionImage", "click", - gContentPane.openTranslationProviderAttribution); - setEventListener("translateButton", "command", - gContentPane.showTranslationExceptions); setEventListener("notificationsDoNotDisturb", "command", gContentPane.toggleDoNotDisturbNotifications); @@ -274,21 +258,6 @@ var gContentPane = { gSubDialog.open("chrome://browser/content/preferences/languages.xul"); }, - /** - * Displays the translation exceptions dialog where specific site and language - * translation preferences can be set. - */ - showTranslationExceptions: function () - { - gSubDialog.open("chrome://browser/content/preferences/translation.xul"); - }, - - openTranslationProviderAttribution: function () - { - Components.utils.import("resource:///modules/translation/Translation.jsm"); - Translation.openProviderAttribution(); - }, - toggleDoNotDisturbNotifications: function (event) { AlertsServiceDND.manualDoNotDisturb = event.target.checked; diff --git a/application/basilisk/components/preferences/in-content/content.xul b/application/basilisk/components/preferences/in-content/content.xul index 9434cba62..fac864411 100644 --- a/application/basilisk/components/preferences/in-content/content.xul +++ b/application/basilisk/components/preferences/in-content/content.xul @@ -22,11 +22,6 @@ - - -