# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("public") {
sources = [
"translate_constants.h",
"translate_infobar_metrics_recorder.h",
"translate_infobar_metrics_recorder.mm",
]
deps = [
"//base",
"//components/translate/core/browser",
]
}
source_set("model") {
sources = [
"chrome_ios_translate_client.h",
"chrome_ios_translate_client.mm",
"language_detection_model_service_factory.h",
"language_detection_model_service_factory.mm",
"language_selection_context.h",
"language_selection_context.mm",
"translate_infobar_tags.h",
"translate_model_service_factory.h",
"translate_model_service_factory.mm",
"translate_ranker_factory.h",
"translate_ranker_factory.mm",
"translate_ranker_metrics_provider.h",
"translate_ranker_metrics_provider.mm",
"translate_service_ios.h",
"translate_service_ios.mm",
]
deps = [
":public",
"//base",
"//components/infobars/core",
"//components/keyed_service/core",
"//components/keyed_service/ios",
"//components/language/core/browser",
"//components/metrics",
"//components/optimization_guide/core:features",
"//components/prefs",
"//components/strings",
"//components/translate/core/browser",
"//components/translate/core/browser:translate_model_service",
"//components/translate/core/common",
"//components/translate/core/language_detection",
"//components/translate/ios/browser",
"//components/web_resource",
"//ios/chrome/app/theme",
"//ios/chrome/browser/infobars/model",
"//ios/chrome/browser/infobars/model:public",
"//ios/chrome/browser/language/model",
"//ios/chrome/browser/optimization_guide/model",
"//ios/chrome/browser/shared/model/application_context",
"//ios/chrome/browser/shared/model/browser_state",
"//ios/chrome/browser/shared/model/profile",
"//ios/chrome/browser/shared/model/url:constants",
"//ios/chrome/browser/shared/ui/util",
"//ios/components/webui:url_constants",
"//ios/web/public",
"//third_party/metrics_proto",
"//ui/base",
"//ui/gfx",
"//url",
]
allow_circular_includes_from = [ "//ios/chrome/browser/infobars/model" ]
}
source_set("unit_tests") {
testonly = true
sources = [
"chrome_ios_translate_client_unittest.mm",
"translate_service_ios_unittest.cc",
]
deps = [
":model",
":public",
":unit_tests_bundle_data",
"//base",
"//base/test:test_support",
"//components/language/core/browser",
"//components/language/ios/browser",
"//components/optimization_guide/core:features",
"//components/optimization_guide/core:prediction",
"//components/prefs",
"//components/prefs:test_support",
"//components/sync_preferences:test_support",
"//components/translate/core/browser",
"//components/translate/core/common",
"//components/translate/core/language_detection",
"//components/translate/ios/browser",
"//ios/chrome/browser/infobars/model",
"//ios/chrome/browser/language/model",
"//ios/chrome/browser/optimization_guide/model",
"//ios/chrome/browser/shared/model/profile/test",
"//ios/chrome/browser/shared/model/url:constants",
"//ios/chrome/browser/web/model:web_internal",
"//ios/chrome/common:string_util",
"//ios/chrome/test:test_support",
"//ios/web/public",
"//ios/web/public/test:test",
"//ios/web/public/test:util",
"//skia",
"//testing/gmock",
"//testing/gtest",
"//url:url",
]
}
source_set("test_support") {
testonly = true
sources = [
"fake_translate_infobar_delegate.h",
"fake_translate_infobar_delegate.mm",
]
deps = [
"//components/infobars/core",
"//components/sync_preferences:test_support",
"//components/translate/core/browser:browser",
"//components/translate/core/browser:test_support",
"//ios/chrome/test/fakes:fakes",
"//testing/gmock",
"//third_party/metrics_proto",
]
}
source_set("eg_app_support+eg2") {
configs += [ "//build/config/ios:xctest_config" ]
testonly = true
sources = [
"translate_app_interface.h",
"translate_app_interface.mm",
]
deps = [
"//base:base",
"//components/translate/core/browser:browser",
"//components/translate/core/common:common",
"//components/translate/ios/browser:browser",
"//ios/chrome/browser/shared/model/browser_state",
"//ios/chrome/browser/shared/model/profile",
"//ios/chrome/browser/translate/model:model",
"//ios/chrome/test/app:test_support",
"//ios/chrome/test/fakes:fakes",
"//ios/web/public/js_messaging",
"//net:net",
]
}
source_set("eg_test_support+eg2") {
configs += [ "//build/config/ios:xctest_config" ]
testonly = true
sources = [
"translate_app_interface.h",
"translate_app_interface_stub.mm",
]
deps = [
"//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/testing/earl_grey:eg_test_support+eg2",
]
}
bundle_data("unit_tests_bundle_data") {
visibility = [ ":unit_tests" ]
testonly = true
sources = [ "//components/test/data/translate/valid_model.tflite" ]
outputs = [ "{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}" ]
}