From f3df64c20b5c86a10680aed2c00df0376538cedc Mon Sep 17 00:00:00 2001 From: bridiver Date: Mon, 11 Jun 2018 13:57:04 -0700 Subject: [PATCH] enable `chrome.i18n.getAcceptLanguages` fix https://github.com/brave/browser-laptop/issues/8326 auditors: @jonathansampson --- .../browser/extensions/atom_extensions_browser_client.cc | 9 +++++++-- chromium_src/BUILD.gn | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/atom/browser/extensions/atom_extensions_browser_client.cc b/atom/browser/extensions/atom_extensions_browser_client.cc index 25b754d4e6..a1d3b91077 100644 --- a/atom/browser/extensions/atom_extensions_browser_client.cc +++ b/atom/browser/extensions/atom_extensions_browser_client.cc @@ -22,6 +22,8 @@ #include "base/version.h" #include "brave/browser/brave_browser_context.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h" +#include "chrome/browser/extensions/api/i18n/i18n_api.h" #include "chrome/browser/extensions/chrome_component_extension_resource_manager.h" #include "chrome/browser/extensions/chrome_extension_api_frame_id_map_helper.h" #include "chrome/browser/extensions/chrome_url_request_util.h" @@ -67,11 +69,9 @@ #include "base/sha1.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" -#include "chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h" #include "extensions/common/file_util.h" #include "net/url_request/url_request_simple_job.h" - #include "electron/brave/common/extensions/api/generated_api_registration.h" #include "extensions/browser/api/generated_api_registration.h" @@ -445,6 +445,11 @@ void AtomExtensionsBrowserClient::RegisterExtensionFunctions( api::CryptotokenPrivateCanOriginAssertAppIdFunction:: histogram_value(), }, + { + NewExtensionFunction, + I18nGetAcceptLanguagesFunction::function_name(), + I18nGetAcceptLanguagesFunction::histogram_value(), + }, }; for (const auto& entry : chromeEntries) { diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index d102aa8ca8..fb277768cf 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -545,6 +545,8 @@ source_set("browser") { "//chrome/browser/extensions/extension_tab_util.h", "//chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc", "//chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h", + "//chrome/browser/extensions/api/i18n/i18n_api.cc", + "//chrome/browser/extensions/api/i18n/i18n_api.h", "chrome/browser/extensions/api/messaging/incognito_connectability.cc", "//chrome/browser/extensions/api/messaging/incognito_connectability.h", "//chrome/browser/extensions/api/messaging/chrome_messaging_delegate.cc",