chromium/ios/chrome/browser/web_selection/model/BUILD.gn

# Copyright 2023 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_ts.gni")

source_set("model") {
  sources = [
    "web_selection_java_script_feature.h",
    "web_selection_java_script_feature.mm",
    "web_selection_java_script_feature_observer.h",
    "web_selection_response.h",
    "web_selection_response.mm",
    "web_selection_tab_helper.h",
    "web_selection_tab_helper.mm",
  ]
  deps = [
    ":web_selection_js",
    "//components/shared_highlighting/ios",
    "//ios/web/js_messaging:scoped_wk_script_message_handler",
    "//ios/web/public",
    "//ios/web/public/js_messaging",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "web_selection_java_script_feature_unittest.mm",
    "web_selection_tab_helper_unittest.mm",
  ]
  deps = [
    ":model",
    "//base/test:test_support",
    "//ios/chrome/browser/shared/model/profile/test",
    "//ios/chrome/browser/shared/public/features",
    "//ios/chrome/browser/web/model:web_internal",
    "//ios/web/public/test",
    "//testing/gtest",
  ]
}

optimize_ts("web_selection_js") {
  visibility = [ ":model" ]

  sources = [ "resources/web_selection.ts" ]
  deps = [
    "//ios/web/public/js_messaging:gcrweb",
    "//ios/web/public/js_messaging:util_scripts",
  ]
}