summaryrefslogtreecommitdiff
path: root/chromium/components/translate/ios/browser/BUILD.gn
blob: f61c879c7c5f621683b640afbd8f7886a55ecc1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//ios/web/public/js_messaging/optimize_js.gni")

source_set("browser") {
  configs += [ "//build/config/compiler:enable_arc" ]
  sources = [
    "ios_translate_driver.h",
    "ios_translate_driver.mm",
    "js_translate_web_frame_manager.h",
    "js_translate_web_frame_manager.mm",
    "js_translate_web_frame_manager_factory.h",
    "js_translate_web_frame_manager_factory.mm",
    "language_detection_controller.h",
    "language_detection_controller.mm",
    "language_detection_model_service.h",
    "language_detection_model_service.mm",
    "string_clipping_util.cc",
    "string_clipping_util.h",
    "translate_controller.h",
    "translate_controller.mm",
    "translate_java_script_feature.h",
    "translate_java_script_feature.mm",
  ]

  deps = [
    ":injected_js",
    "//base",
    "//components/keyed_service/core",
    "//components/language/ios/browser",
    "//components/prefs",
    "//components/translate/core/browser",
    "//components/translate/core/browser:translate_model_service",
    "//components/translate/core/common",
    "//components/translate/core/language_detection",
    "//components/ukm/ios:ukm_url_recorder",
    "//ios/web/common",
    "//ios/web/public",
    "//ios/web/public/js_messaging",
    "//net",
    "//net/traffic_annotation:traffic_annotation",
    "//services/network/public/cpp:cpp_base",
    "//ui/base",
    "//url",
  ]
}

optimize_js("injected_js") {
  visibility = [ ":browser" ]
  primary_script = "resources/translate_ios.js"
  sources = [ "resources/translate_ios.js" ]

  deps = [
    "//ios/web/public/js_messaging:gcrweb",
    "//ios/web/public/js_messaging:util_scripts",
  ]
}

source_set("unit_tests") {
  configs += [ "//build/config/compiler:enable_arc" ]
  testonly = true
  sources = [
    "js_translate_web_frame_manager_unittest.mm",
    "string_clipping_util_unittest.cc",
    "translate_controller_unittest.mm",
  ]

  deps = [
    ":browser",
    "//base",
    "//base/test:test_support",
    "//components/language/ios/browser",
    "//components/resources",
    "//ios/web/public/js_messaging",
    "//ios/web/public/test",
    "//ios/web/public/test:test_fixture",
    "//testing/gtest",
    "//ui/base",
    "//url",
  ]
}