From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 12 Feb 2018 21:28:53 +0100
Subject: ungoogled-chromium: Disable translate integration

---
 components/translate/content/renderer/translate_helper.cc | 4 +++-
 components/translate/core/browser/translate_manager.cc    | 2 +-
 components/translate/core/browser/translate_script.cc     | 3 +--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/components/translate/content/renderer/translate_helper.cc b/components/translate/content/renderer/translate_helper.cc
--- a/components/translate/content/renderer/translate_helper.cc
+++ b/components/translate/content/renderer/translate_helper.cc
@@ -74,7 +74,9 @@ TranslateHelper::TranslateHelper(content::RenderFrame* render_frame,
       world_id_(world_id),
       extension_scheme_(extension_scheme),
       binding_(this),
-      weak_method_factory_(this) {}
+      weak_method_factory_(this) {
+  CancelPendingTranslation();
+}
 
 TranslateHelper::~TranslateHelper() {
 }
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc
--- a/components/translate/core/browser/translate_manager.cc
+++ b/components/translate/core/browser/translate_manager.cc
@@ -102,7 +102,7 @@ void TranslateManager::InitiateTranslation(const std::string& page_lang) {
   if (net::NetworkChangeNotifier::IsOffline())
     return;
 
-  if (!ignore_missing_key_for_testing_ && !::google_apis::HasKeysConfigured()) {
+  if (true) {
     // Without an API key, translate won't work, so don't offer to translate in
     // the first place. Leave prefs::kOfferTranslateEnabled on, though, because
     // that settings syncs and we don't want to turn off translate everywhere
diff --git a/components/translate/core/browser/translate_script.cc b/components/translate/core/browser/translate_script.cc
--- a/components/translate/core/browser/translate_script.cc
+++ b/components/translate/core/browser/translate_script.cc
@@ -149,9 +149,8 @@ void TranslateScript::OnScriptFetchComplete(
     base::StringAppendF(&data_, "var serverParams = '%s';\n",
                         server_params.c_str());
 
-    GURL security_origin = translate::GetTranslateSecurityOrigin();
     base::StringAppendF(
-        &data_, "var securityOrigin = '%s';", security_origin.spec().c_str());
+        &data_, "var securityOrigin = '';");
 
     // Append embedded translate.js and a remote element library.
     base::StringPiece str =
-- 
2.7.4

