chromium/components/send_tab_to_self/BUILD.gn

# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

if (is_android) {
  import("//build/config/android/rules.gni")
}

static_library("send_tab_to_self") {
  sources = [
    "entry_point_display_reason.cc",
    "entry_point_display_reason.h",
    "features.cc",
    "features.h",
    "metrics_util.cc",
    "metrics_util.h",
    "pref_names.cc",
    "pref_names.h",
    "send_tab_to_self_bridge.cc",
    "send_tab_to_self_bridge.h",
    "send_tab_to_self_data_type_controller.cc",
    "send_tab_to_self_data_type_controller.h",
    "send_tab_to_self_entry.cc",
    "send_tab_to_self_entry.h",
    "send_tab_to_self_model.cc",
    "send_tab_to_self_model.h",
    "send_tab_to_self_model_observer.h",
    "send_tab_to_self_sync_service.cc",
    "send_tab_to_self_sync_service.h",
    "target_device_info.cc",
    "target_device_info.h",
  ]
  deps = [
    "//base",
    "//components/history/core/browser",
    "//components/keyed_service/core",
    "//components/prefs",
    "//components/send_tab_to_self/proto:send_tab_to_self_proto",
    "//components/signin/public/base",
    "//components/signin/public/identity_manager",
    "//components/strings",
    "//components/sync",
    "//components/sync_device_info",
    "//components/version_info",
    "//google_apis",
    "//ui/base",
    "//url",
  ]
  public_deps = [ "//components/send_tab_to_self/proto:send_tab_to_self_proto" ]
  if (is_android) {
    sources += [
      "send_tab_to_self_infobar_delegate.cc",
      "send_tab_to_self_infobar_delegate.h",
    ]
    deps += [
      "//components/infobars/core",
      "//content/public/browser",
    ]
  }
}

if (is_android) {
  java_cpp_enum("java_enum_srcjar") {
    visibility = [ ":*" ]
    sources = [ "entry_point_display_reason.h" ]
  }

  android_library("send_tab_to_self_java") {
    srcjar_deps = [ ":java_enum_srcjar" ]

    # Important: the generated enum uses the @IntDef annotation provided by
    # this dependency.
    deps = [ "//third_party/androidx:androidx_annotation_annotation_java" ]
  }
}

source_set("test_support") {
  testonly = true
  sources = [
    "test_send_tab_to_self_model.cc",
    "test_send_tab_to_self_model.h",
  ]
  deps = [
    ":send_tab_to_self",
    "//base",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "entry_point_display_reason_unittest.cc",
    "send_tab_to_self_bridge_unittest.cc",
    "send_tab_to_self_entry_unittest.cc",
    "target_device_info_unittest.cc",
  ]
  deps = [
    ":send_tab_to_self",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/history/core/browser",
    "//components/prefs:test_support",
    "//components/send_tab_to_self/proto:send_tab_to_self_proto",
    "//components/sync:test_support",
    "//components/sync_device_info:test_support",
    "//components/sync_preferences:test_support",
    "//testing/gtest",
    "//url",
  ]
}