| # Copyright 2021 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/ui.gni") |
| |
| if (!is_android && !is_ios) { |
| static_library("live_caption") { |
| sources = [ |
| "caption_bubble_context.h", |
| "caption_bubble_context_remote.cc", |
| "caption_bubble_context_remote.h", |
| "caption_bubble_controller.h", |
| "caption_bubble_session_observer.h", |
| "caption_bubble_settings.h", |
| "caption_controller_base.cc", |
| "caption_controller_base.h", |
| "live_caption_bubble_settings.cc", |
| "live_caption_bubble_settings.h", |
| "live_caption_controller.cc", |
| "live_caption_controller.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//components/keyed_service/core", |
| "//components/live_caption:constants", |
| "//components/live_caption:utils", |
| "//components/pref_registry", |
| "//components/prefs", |
| "//components/soda", |
| "//components/soda:constants", |
| "//components/sync_preferences", |
| "//media", |
| "//media/mojo/mojom", |
| "//mojo/public/cpp/bindings", |
| "//ui/native_theme", |
| ] |
| |
| if (toolkit_views) { |
| sources += [ |
| "views/caption_bubble.cc", |
| "views/caption_bubble.h", |
| "views/caption_bubble_controller_views.cc", |
| "views/caption_bubble_controller_views.h", |
| "views/caption_bubble_model.cc", |
| "views/caption_bubble_model.h", |
| "views/format_constants.h", |
| "views/translation_view_wrapper.cc", |
| "views/translation_view_wrapper.h", |
| "views/translation_view_wrapper_base.cc", |
| "views/translation_view_wrapper_base.h", |
| ] |
| |
| public_deps = [ "//ui/base/mojom:ui_base_types" ] |
| |
| deps += [ |
| "//components/language/core/common", |
| "//components/strings", |
| "//components/translate/core/browser", |
| "//components/vector_icons", |
| "//third_party/re2", |
| "//ui/accessibility", |
| "//ui/base", |
| "//ui/compositor", |
| "//ui/gfx", |
| "//ui/menus", |
| "//ui/strings:ui_strings_grit", |
| "//ui/views", |
| ] |
| } # toolkit_views |
| } |
| |
| static_library("live_translate") { |
| sources = [ |
| "greedy_text_stabilizer.cc", |
| "greedy_text_stabilizer.h", |
| "live_translate_controller.cc", |
| "live_translate_controller.h", |
| "translation_dispatcher.cc", |
| "translation_dispatcher.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//components/keyed_service/core", |
| "//components/live_caption:constants", |
| "//components/live_caption:utils", |
| "//components/pref_registry", |
| "//components/prefs", |
| "//components/soda", |
| "//components/soda:constants", |
| "//components/sync_preferences", |
| "//content/public/browser", |
| "//google_apis", |
| "//media", |
| "//media/mojo/mojom", |
| "//net", |
| "//services/data_decoder/public/cpp", |
| "//services/data_decoder/public/mojom", |
| "//services/network/public/cpp", |
| "//services/network/public/mojom", |
| "//ui/native_theme", |
| ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| |
| sources = [ |
| "caption_controller_base_unittest.cc", |
| "greedy_text_stabilizer_unittest.cc", |
| "live_caption_bubble_settings_unittest.cc", |
| ] |
| |
| deps = [ |
| ":live_caption", |
| ":live_translate", |
| "//base", |
| "//base/test:test_support", |
| "//components/live_caption:constants", |
| "//components/prefs", |
| "//components/prefs:test_support", |
| "//media/mojo/mojom:speech_recognition", |
| "//mojo/public/cpp/bindings", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//ui/gfx/geometry", |
| ] |
| |
| if (is_chromeos) { |
| sources += [ |
| "caption_bubble_context_remote_unittest.cc", |
| |
| # This test verifies behavior of the controller |
| # in an ash environment and requires ash dependencies. |
| "live_caption_controller_unittest.cc", |
| ] |
| |
| deps += [ |
| ":constants", |
| "//ash/constants", |
| "//components/pref_registry", |
| "//components/soda", |
| "//components/soda:constants", |
| "//components/soda:test_support", |
| "//ui/native_theme", |
| "//ui/views", |
| ] |
| } |
| } |
| } # !is_android |
| |
| source_set("constants") { |
| sources = [ |
| "pref_names.cc", |
| "pref_names.h", |
| ] |
| |
| deps = [ |
| "//base", |
| "//components/prefs", |
| "//media", |
| ] |
| |
| if (!is_android) { |
| deps += [ "//components/soda:constants" ] |
| } |
| } |
| |
| source_set("utils") { |
| sources = [ |
| "caption_util.cc", |
| "caption_util.h", |
| "translation_util.cc", |
| "translation_util.h", |
| ] |
| |
| deps = [ |
| ":constants", |
| "//base", |
| "//components/prefs", |
| "//media", |
| "//third_party/icu", |
| "//third_party/re2", |
| "//ui/base", |
| "//ui/native_theme", |
| ] |
| |
| if (!is_android) { |
| deps += [ "//components/soda:utils" ] |
| } |
| } |