diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-06 12:48:11 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:33:43 +0000 |
commit | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (patch) | |
tree | fa14ba0ca8d2683ba2efdabd246dc9b18a1229c6 /chromium/components/translate/content | |
parent | 79b4f909db1049fca459c07cca55af56a9b54fe3 (diff) | |
download | qtwebengine-chromium-7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3.tar.gz |
BASELINE: Update Chromium to 84.0.4147.141
Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/translate/content')
3 files changed, 46 insertions, 3 deletions
diff --git a/chromium/components/translate/content/browser/BUILD.gn b/chromium/components/translate/content/browser/BUILD.gn index 8b35e2db3e3..1844a9ebd8d 100644 --- a/chromium/components/translate/content/browser/BUILD.gn +++ b/chromium/components/translate/content/browser/BUILD.gn @@ -10,6 +10,10 @@ static_library("browser") { "content_record_page_language.h", "content_translate_driver.cc", "content_translate_driver.h", + "content_translate_util.cc", + "content_translate_util.h", + "per_frame_content_translate_driver.cc", + "per_frame_content_translate_driver.h", ] public_deps = [ @@ -17,13 +21,42 @@ static_library("browser") { "//components/translate/content/common", "//components/translate/core/browser", "//components/translate/core/common", + "//content/public/browser", ] deps = [ "//components/language/core/browser", "//components/search_engines:search_engines", + "//components/services/language_detection/public/cpp", + "//components/services/language_detection/public/mojom", + "//components/translate/core/language_detection:language_detection", "//components/ukm/content", - "//content/public/browser", "//content/public/common", "//net", ] } + +source_set("unit_tests") { + testonly = true + sources = [ "per_frame_content_translate_driver_unittest.cc" ] + + deps = [ + ":browser", + "//base", + "//content/test:test_support", + "//testing/gtest", + ] +} + +static_library("test_support") { + testonly = true + + sources = [ + "translate_waiter.cc", + "translate_waiter.h", + ] + public_deps = [ + ":browser", + "//base", + "//components/translate/core/common", + ] +} diff --git a/chromium/components/translate/content/common/translate.mojom b/chromium/components/translate/content/common/translate.mojom index 09f028252d0..aaf8fa4e5ec 100644 --- a/chromium/components/translate/content/common/translate.mojom +++ b/chromium/components/translate/content/common/translate.mojom @@ -36,9 +36,17 @@ struct LanguageDetectionDetails { }; // Handles language translation. This is used by the browser process to -// direct a renderer to translate the language of a frame (or revert a -// previous translation of the contents of a frame). +// direct a renderer to detect the language details of a frame and translate +// the language of a frame (or revert a previous translation of the contents +// of a frame. interface TranslateAgent { + // Requests that the frame's language details be detected and returned to + // the browser process. This includes the html root language, the content + // language metadata, and whether the notranslate metadata is present. + GetWebLanguageDetectionDetails() + => (string content_meta_language, string html_root_lang, + url.mojom.Url url, bool has_notranslate_meta); + // Requests that the frame be translated from |source_lang| to // |target_lang|. // diff --git a/chromium/components/translate/content/renderer/BUILD.gn b/chromium/components/translate/content/renderer/BUILD.gn index 1d903e00db9..bae4efd5362 100644 --- a/chromium/components/translate/content/renderer/BUILD.gn +++ b/chromium/components/translate/content/renderer/BUILD.gn @@ -6,6 +6,8 @@ import("//build/config/features.gni") static_library("renderer") { sources = [ + "per_frame_translate_agent.cc", + "per_frame_translate_agent.h", "translate_agent.cc", "translate_agent.h", ] |