chromium/chromeos/ash/components/phonehub/BUILD.gn

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

import("//build/config/chromeos/ui_mode.gni")
import("//testing/test.gni")

assert(is_chromeos_ash, "Phone Hub is Ash only")

static_library("phonehub") {
  sources = [
    "app_stream_launcher_data_model.cc",
    "app_stream_launcher_data_model.h",
    "app_stream_manager.cc",
    "app_stream_manager.h",
    "browser_tabs_metadata_fetcher.h",
    "browser_tabs_model.cc",
    "browser_tabs_model.h",
    "browser_tabs_model_controller.cc",
    "browser_tabs_model_controller.h",
    "browser_tabs_model_provider.cc",
    "browser_tabs_model_provider.h",
    "camera_roll_download_manager.h",
    "camera_roll_item.cc",
    "camera_roll_item.h",
    "camera_roll_manager.cc",
    "camera_roll_manager.h",
    "camera_roll_manager_impl.cc",
    "camera_roll_manager_impl.h",
    "camera_roll_thumbnail_decoder.h",
    "camera_roll_thumbnail_decoder_impl.cc",
    "camera_roll_thumbnail_decoder_impl.h",
    "combined_access_setup_operation.cc",
    "combined_access_setup_operation.h",
    "connection_scheduler.h",
    "connection_scheduler_impl.cc",
    "connection_scheduler_impl.h",
    "cros_state_sender.cc",
    "cros_state_sender.h",
    "do_not_disturb_controller.cc",
    "do_not_disturb_controller.h",
    "do_not_disturb_controller_impl.cc",
    "do_not_disturb_controller_impl.h",
    "feature_setup_connection_operation.cc",
    "feature_setup_connection_operation.h",
    "feature_setup_response_processor.cc",
    "feature_setup_response_processor.h",
    "feature_status.cc",
    "feature_status.h",
    "feature_status_provider.cc",
    "feature_status_provider.h",
    "feature_status_provider_impl.cc",
    "feature_status_provider_impl.h",
    "find_my_device_controller.cc",
    "find_my_device_controller.h",
    "find_my_device_controller_impl.cc",
    "find_my_device_controller_impl.h",
    "icon_decoder.cc",
    "icon_decoder.h",
    "icon_decoder_impl.cc",
    "icon_decoder_impl.h",
    "invalid_connection_disconnector.cc",
    "invalid_connection_disconnector.h",
    "message_receiver.cc",
    "message_receiver.h",
    "message_receiver_impl.cc",
    "message_receiver_impl.h",
    "message_sender.h",
    "message_sender_impl.cc",
    "message_sender_impl.h",
    "multidevice_feature_access_manager.cc",
    "multidevice_feature_access_manager.h",
    "multidevice_feature_access_manager_impl.cc",
    "multidevice_feature_access_manager_impl.h",
    "multidevice_setup_state_updater.cc",
    "multidevice_setup_state_updater.h",
    "mutable_phone_model.cc",
    "mutable_phone_model.h",
    "notification.cc",
    "notification.h",
    "notification_access_setup_operation.cc",
    "notification_access_setup_operation.h",
    "notification_click_handler.h",
    "notification_interaction_handler.cc",
    "notification_interaction_handler.h",
    "notification_interaction_handler_impl.cc",
    "notification_interaction_handler_impl.h",
    "notification_manager.cc",
    "notification_manager.h",
    "notification_manager_impl.cc",
    "notification_manager_impl.h",
    "notification_processor.cc",
    "notification_processor.h",
    "onboarding_ui_tracker.cc",
    "onboarding_ui_tracker.h",
    "onboarding_ui_tracker_impl.cc",
    "onboarding_ui_tracker_impl.h",
    "phone_hub_manager.h",
    "phone_hub_manager_impl.cc",
    "phone_hub_manager_impl.h",
    "phone_hub_metrics_recorder.cc",
    "phone_hub_metrics_recorder.h",
    "phone_hub_structured_metrics_logger.cc",
    "phone_hub_structured_metrics_logger.h",
    "phone_hub_ui_readiness_recorder.cc",
    "phone_hub_ui_readiness_recorder.h",
    "phone_model.cc",
    "phone_model.h",
    "phone_status_model.cc",
    "phone_status_model.h",
    "phone_status_processor.cc",
    "phone_status_processor.h",
    "ping_manager.h",
    "ping_manager_impl.cc",
    "ping_manager_impl.h",
    "pref_names.cc",
    "pref_names.h",
    "public/cpp/attestation_certificate_generator.cc",
    "public/cpp/attestation_certificate_generator.h",
    "recent_app_click_observer.h",
    "recent_apps_interaction_handler.cc",
    "recent_apps_interaction_handler.h",
    "recent_apps_interaction_handler_impl.cc",
    "recent_apps_interaction_handler_impl.h",
    "screen_lock_manager.cc",
    "screen_lock_manager.h",
    "screen_lock_manager_impl.cc",
    "screen_lock_manager_impl.h",
    "tether_controller.cc",
    "tether_controller.h",
    "tether_controller_impl.cc",
    "tether_controller_impl.h",
    "url_constants.cc",
    "url_constants.h",
    "user_action_recorder.h",
    "user_action_recorder_impl.cc",
    "user_action_recorder_impl.h",
    "util/histogram_util.cc",
    "util/histogram_util.h",
  ]

  deps = [
    "//ash/constants",
    "//ash/public/cpp:cpp",
    "//ash/resources/vector_icons",
    "//ash/webui/eche_app_ui:eche_app_ui_pref",
    "//ash/webui/eche_app_ui:eche_connection_status",
    "//ash/webui/eche_app_ui:system_info_provider",
    "//ash/webui/eche_app_ui/mojom:mojom",
    "//base",
    "//chromeos/ash/components/multidevice",
    "//chromeos/ash/components/multidevice/logging",
    "//chromeos/ash/components/phonehub/proto",
    "//chromeos/ash/services/device_sync/public/cpp",
    "//chromeos/ash/services/multidevice_setup/public/cpp",
    "//chromeos/ash/services/multidevice_setup/public/cpp:prefs",
    "//chromeos/ash/services/network_config:in_process_instance",
    "//chromeos/ash/services/secure_channel/public/cpp/client",
    "//chromeos/ash/services/secure_channel/public/mojom",
    "//chromeos/dbus/power",
    "//chromeos/services/network_config/public/cpp",
    "//components/keyed_service/core",
    "//components/metrics/structured:structured_events",
    "//components/metrics/structured:structured_metrics_features",
    "//components/prefs",
    "//components/session_manager/core",
    "//device/bluetooth",
    "//net",
    "//services/data_decoder/public/cpp",
    "//skia",
    "//ui/gfx",
    "//url",
  ]
}

# Sources only include files used in the debug UI.
static_library("debug") {
  sources = [
    "fake_browser_tabs_model_provider.cc",
    "fake_browser_tabs_model_provider.h",
    "fake_camera_roll_manager.cc",
    "fake_camera_roll_manager.h",
    "fake_connection_scheduler.cc",
    "fake_connection_scheduler.h",
    "fake_do_not_disturb_controller.cc",
    "fake_do_not_disturb_controller.h",
    "fake_feature_status_provider.cc",
    "fake_feature_status_provider.h",
    "fake_find_my_device_controller.cc",
    "fake_find_my_device_controller.h",
    "fake_icon_decoder.cc",
    "fake_icon_decoder.h",
    "fake_multidevice_feature_access_manager.cc",
    "fake_multidevice_feature_access_manager.h",
    "fake_notification_interaction_handler.cc",
    "fake_notification_interaction_handler.h",
    "fake_notification_manager.cc",
    "fake_notification_manager.h",
    "fake_onboarding_ui_tracker.cc",
    "fake_onboarding_ui_tracker.h",
    "fake_phone_hub_manager.cc",
    "fake_phone_hub_manager.h",
    "fake_ping_manager.cc",
    "fake_ping_manager.h",
    "fake_recent_apps_interaction_handler.cc",
    "fake_recent_apps_interaction_handler.h",
    "fake_screen_lock_manager.cc",
    "fake_screen_lock_manager.h",
    "fake_tether_controller.cc",
    "fake_tether_controller.h",
    "fake_user_action_recorder.cc",
    "fake_user_action_recorder.h",
  ]

  public_deps = [ ":phonehub" ]

  deps = [
    "//ash/constants",
    "//ash/webui/eche_app_ui:eche_connection_status",
    "//ash/webui/eche_app_ui:system_info_provider",
    "//base",
    "//chromeos/ash/components/multidevice/logging",
    "//chromeos/ash/components/phonehub/proto",
    "//chromeos/ash/services/multidevice_setup/public/mojom",
  ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "fake_attestation_certificate_generator.cc",
    "fake_attestation_certificate_generator.h",
    "fake_browser_tabs_metadata_fetcher.cc",
    "fake_browser_tabs_metadata_fetcher.h",
    "fake_browser_tabs_model_provider.cc",
    "fake_browser_tabs_model_provider.h",
    "fake_camera_roll_download_manager.cc",
    "fake_camera_roll_download_manager.h",
    "fake_message_receiver.h",
    "fake_message_sender.cc",
    "fake_message_sender.h",
    "fake_ping_manager.cc",
    "fake_ping_manager.h",
    "phone_model_test_util.cc",
    "phone_model_test_util.h",
  ]

  public_deps = [
    ":debug",
    ":phonehub",
  ]

  deps = [
    "//base",
    "//chromeos/ash/components/phonehub/proto",
    "//chromeos/ash/services/secure_channel/public/mojom",
    "//skia",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "app_stream_launcher_data_model_unittest.cc",
    "browser_tabs_model_controller_unittest.cc",
    "browser_tabs_model_unittest.cc",
    "camera_roll_item_unittest.cc",
    "camera_roll_manager_impl_unittest.cc",
    "camera_roll_thumbnail_decoder_impl_unittest.cc",
    "connection_scheduler_impl_unittest.cc",
    "cros_state_sender_unittest.cc",
    "do_not_disturb_controller_impl_unittest.cc",
    "feature_setup_response_processor_unittest.cc",
    "feature_status_provider_impl_unittest.cc",
    "find_my_device_controller_impl_unittest.cc",
    "icon_decoder_impl_unittest.cc",
    "invalid_connection_disconnector_unittest.cc",
    "message_receiver_unittest.cc",
    "message_sender_unittest.cc",
    "multidevice_feature_access_manager_impl_unittest.cc",
    "multidevice_setup_state_updater_unittest.cc",
    "mutable_phone_model_unittest.cc",
    "notification_interaction_handler_impl_unittest.cc",
    "notification_manager_impl_unittest.cc",
    "notification_processor_unittest.cc",
    "onboarding_ui_tracker_impl_unittest.cc",
    "phone_hub_structured_metrics_logger_unittest.cc",
    "phone_hub_ui_readiness_recorder_unittest.cc",
    "phone_status_model_unittest.cc",
    "phone_status_processor_unittest.cc",
    "ping_manager_impl_unittest.cc",
    "recent_apps_interaction_handler_impl_unittest.cc",
    "screen_lock_manager_impl_unittest.cc",
    "tether_controller_impl_unittest.cc",
    "user_action_recorder_impl_unittest.cc",
  ]

  deps = [
    ":debug",
    ":phonehub",
    ":test_support",
    "//ash/constants",
    "//ash/webui/eche_app_ui:eche_app_ui_pref",
    "//ash/webui/eche_app_ui:eche_connection_status",
    "//ash/webui/eche_app_ui:system_info_provider",
    "//base",
    "//base/test:test_support",
    "//chromeos/ash/components/multidevice",
    "//chromeos/ash/components/multidevice:test_support",
    "//chromeos/ash/components/network",
    "//chromeos/ash/components/network:test_support",
    "//chromeos/ash/components/phonehub/proto",
    "//chromeos/ash/services/device_sync/public/cpp",
    "//chromeos/ash/services/device_sync/public/cpp:test_support",
    "//chromeos/ash/services/multidevice_setup/public/cpp",
    "//chromeos/ash/services/multidevice_setup/public/cpp:prefs",
    "//chromeos/ash/services/multidevice_setup/public/cpp:test_support",
    "//chromeos/ash/services/network_config:in_process_instance",
    "//chromeos/ash/services/network_config/public/cpp:test_support",
    "//chromeos/ash/services/secure_channel/public/cpp/client:test_support",
    "//chromeos/ash/services/secure_channel/public/mojom",
    "//chromeos/dbus/power",
    "//components/metrics/structured:structured_metrics_features",
    "//components/prefs:test_support",
    "//components/session_manager/core",
    "//device/bluetooth:mocks",
    "//skia",
    "//testing/gtest",
    "//ui/gfx",
    "//ui/gfx:test_support",
  ]
}