chromium/ios/web/find_in_page/BUILD.gn

# Copyright 2019 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/compile_ts.gni")
import("//ios/web/public/js_messaging/optimize_ts.gni")

source_set("find_in_page") {
  deps = [
    ":compile_ts",
    ":find_in_page_event_listeners_js",
    ":find_in_page_js",
    "//base",
    "//ios/web/js_messaging",
    "//ios/web/public/",
    "//ios/web/public/find_in_page",
    "//ios/web/public/js_messaging",
    "//ios/web/web_state:web_state_impl_header",
  ]
  sources = [
    "crw_find_interaction.mm",
    "crw_find_session.mm",
    "find_in_page_constants.h",
    "find_in_page_constants.mm",
    "find_in_page_java_script_feature.h",
    "find_in_page_java_script_feature.mm",
    "find_in_page_manager.mm",
    "find_in_page_manager_delegate_bridge.mm",
    "find_in_page_manager_impl.h",
    "find_in_page_manager_impl.mm",
    "find_in_page_metrics.h",
    "find_in_page_metrics.mm",
    "java_script_find_in_page_manager_impl.h",
    "java_script_find_in_page_manager_impl.mm",
    "java_script_find_in_page_request.h",
    "java_script_find_in_page_request.mm",
  ]
  frameworks = [ "UIKit.framework" ]
}

compile_ts("compile_ts") {
  sources = [
    "resources/find_in_page.ts",
    "resources/find_in_page_constants.ts",
    "resources/find_in_page_utils.ts",
  ]
}

optimize_ts("find_in_page_js") {
  visibility = [ ":find_in_page" ]

  sources = [ "resources/find_in_page_native_api.ts" ]

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

optimize_ts("find_in_page_event_listeners_js") {
  visibility = [ ":find_in_page" ]

  sources = [ "resources/find_in_page_event_listeners.ts" ]

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

source_set("find_in_page_unittests") {
  testonly = true
  deps = [
    ":find_in_page",
    "//base",
    "//base/test:test_support",
    "//ios/web/js_messaging",
    "//ios/web/js_messaging:java_script_feature",
    "//ios/web/public",
    "//ios/web/public/find_in_page",
    "//ios/web/public/js_messaging",
    "//ios/web/public/test",
    "//ios/web/public/test:test_fixture",
    "//ios/web/public/test/fakes",
    "//ios/web/test/fakes",
    "//ios/web/web_state/ui:wk_web_view_configuration_provider_header",
    "//testing/gtest",
  ]

  sources = [
    "find_in_page_js_unittest.mm",
    "find_in_page_manager_delegate_bridge_unittest.mm",
    "find_in_page_manager_impl_unittest.mm",
    "java_script_find_in_page_manager_impl_unittest.mm",
    "java_script_find_in_page_request_unittest.mm",
  ]
}