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

assert(is_win || is_mac || is_linux || is_chromeos || is_ohos)

import("//chrome/common/features.gni")

source_set("saved_tab_groups") {
  sources = [
    "collaboration_messaging_observer.h",
    "collaboration_messaging_observer_factory.h",
    "collaboration_messaging_page_action_controller.h",
    "collaboration_messaging_tab_data.h",
    "instant_message_queue_processor.h",
    "local_tab_group_listener.h",
    "most_recent_shared_tab_update_store.h",
    "saved_tab_group_controller.h",
    "saved_tab_group_metrics.h",
    "saved_tab_group_model_listener.h",
    "saved_tab_group_on_close_helper.h",
    "saved_tab_group_pref_names.h",
    "saved_tab_group_utils.h",
    "saved_tab_group_web_contents_listener.h",
    "session_service_tab_group_sync_observer.h",
    "shared_tab_group_feedback_controller.h",
    "tab_group_action_context_desktop.h",
    "tab_group_menu_utils.h",
    "tab_group_sync_delegate_desktop.h",
  ]
  public_deps = [
    "//base",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui:browser_list",
    "//chrome/browser/ui/browser_window",
    "//chrome/browser/ui/tabs:tab_group",
    "//chrome/browser/ui/tabs:tab_strip",
    "//chrome/browser/ui/tabs:tab_strip_model_observer",
    "//chrome/browser/ui/toasts",
    "//chrome/browser/ui/views/page_action",
    "//components/collaboration/public",
    "//components/data_sharing/public:group_data",
    "//components/keyed_service/core",
    "//components/pref_registry",
    "//components/prefs",
    "//components/saved_tab_groups/delegate",
    "//components/saved_tab_groups/internal:model",
    "//components/saved_tab_groups/public",
    "//components/sessions:session_id",
    "//components/sync/base",
    "//components/sync/model",
    "//components/tab_groups",
    "//components/tabs:public",
    "//components/user_education/common",
    "//content/public/browser",
    "//ui/base",
    "//ui/base:types",
    "//ui/base/unowned_user_data",
    "//ui/gfx",
    "//ui/gfx/range",
    "//url",
  ]
}

source_set("impl") {
  sources = [
    "collaboration_messaging_observer.cc",
    "collaboration_messaging_observer_factory.cc",
    "collaboration_messaging_page_action_controller.cc",
    "collaboration_messaging_tab_data.cc",
    "instant_message_queue_processor.cc",
    "local_tab_group_listener.cc",
    "most_recent_shared_tab_update_store.cc",
    "saved_tab_group_metrics.cc",
    "saved_tab_group_model_listener.cc",
    "saved_tab_group_on_close_helper.cc",
    "saved_tab_group_pref_names.cc",
    "saved_tab_group_utils.cc",
    "saved_tab_group_web_contents_listener.cc",
    "session_service_tab_group_sync_observer.cc",
    "shared_tab_group_feedback_controller.cc",
    "tab_group_action_context_desktop.cc",
    "tab_group_menu_utils.cc",
    "tab_group_sync_delegate_desktop.cc",
  ]
  deps = [
    ":saved_tab_groups",
    "//base",
    "//chrome/app:generated_resources",
    "//chrome/app/vector_icons",
    "//chrome/browser:browser_process",
    "//chrome/browser/favicon",
    "//chrome/browser/image_fetcher",
    "//chrome/browser/profiles",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/signin",
    "//chrome/browser/sync",
    "//chrome/browser/sync:factories",
    "//chrome/browser/tab_group_sync:factories",
    "//chrome/browser/ui:browser_element_identifiers",
    "//chrome/browser/ui:browser_list",
    "//chrome/browser/ui:layout_constants",
    "//chrome/browser/ui/actions:actions_headers",
    "//chrome/browser/ui/bookmarks",
    "//chrome/browser/ui/browser_window",
    "//chrome/browser/ui/page_action:icon_type",
    "//chrome/browser/ui/tabs:tab_group",
    "//chrome/browser/ui/tabs:tab_strip",
    "//chrome/browser/ui/tabs:tab_strip_model_observer",
    "//chrome/browser/ui/tabs:tabs_public",
    "//chrome/browser/ui/toasts",
    "//chrome/browser/ui/toasts/api:toasts",
    "//chrome/browser/ui/user_education",
    "//chrome/browser/ui/views/frame",
    "//chrome/browser/ui/views/page_action",
    "//chrome/browser/ui/views/toolbar",
    "//chrome/common",
    "//chrome/common:channel_info",
    "//chrome/common:constants",
    "//components/collaboration/public",
    "//components/data_sharing/public",
    "//components/data_sharing/public:features",
    "//components/data_sharing/public:group_data",
    "//components/favicon/core",
    "//components/favicon_base",
    "//components/feature_engagement/public:feature_constants",
    "//components/image_fetcher/core",
    "//components/pref_registry",
    "//components/prefs",
    "//components/saved_tab_groups/internal",
    "//components/saved_tab_groups/internal:tab_group_sync_bridge",
    "//components/saved_tab_groups/public",
    "//components/saved_tab_groups/public:features",
    "//components/saved_tab_groups/public:prefs",
    "//components/sessions:session_id",
    "//components/signin/public/base",
    "//components/signin/public/identity_manager",
    "//components/sync/base",
    "//components/sync/base:features",
    "//components/sync/model",
    "//components/sync/service",
    "//components/sync_device_info",
    "//components/tab_groups",
    "//components/tabs:public",
    "//components/user_education/common",
    "//content/public/browser",
    "//ui/base",
    "//ui/color:color_headers",
    "//ui/compositor",
    "//ui/gfx",
    "//ui/gfx/range",
    "//ui/views",
    "//url",
  ]
  public_deps = [ "//chrome/browser:browser_public_dependencies" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "collaboration_messaging_page_action_controller_unittest.cc",
    "collaboration_messaging_tab_data_unittest.cc",
    "instant_message_queue_processor_unittest.cc",
    "tab_group_menu_utils_unittest.cc",
  ]
  deps = [
    ":saved_tab_groups",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//chrome/app:generated_resources",
    "//chrome/browser/favicon",
    "//chrome/browser/ui:ui_features",
    "//chrome/browser/ui/actions:actions_headers",
    "//chrome/browser/ui/tabs:tab_group",
    "//chrome/browser/ui/tabs:tab_model",
    "//chrome/browser/ui/tabs:tab_strip",
    "//chrome/browser/ui/tabs:tabs_public",
    "//chrome/browser/ui/toasts",
    "//chrome/browser/ui/toasts/api:toasts",
    "//chrome/browser/ui/views/page_action:test_support",
    "//chrome/common",
    "//chrome/test:test_support",
    "//components/collaboration/public",
    "//components/data_sharing:test_support",
    "//components/data_sharing/public",
    "//components/data_sharing/public:features",
    "//components/data_sharing/public:group_data",
    "//components/saved_tab_groups/internal:model",
    "//components/saved_tab_groups/public",
    "//components/saved_tab_groups/public:features",
    "//components/saved_tab_groups/test_support",
    "//components/signin/public/base",
    "//components/tab_groups",
    "//components/tabs:public",
    "//components/tabs:test_support",
    "//content/public/browser",
    "//content/test:test_support",
    "//testing/gtest",
    "//ui/base",
    "//ui/base:types",
    "//ui/base/mojom:ui_base_types",
  ]
}

source_set("browser_tests") {
  testonly = true
  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
  sources = [
    "collaboration_messaging_observer_browsertest.cc",
    "collaboration_messaging_page_action_controller_browsertest.cc",
    "saved_tab_group_web_contents_listener_browsertest.cc",
    "tab_group_sync_delegate_browsertest.cc",
    "tab_group_sync_navigation_browser_test.cc",
  ]
  deps = [
    ":saved_tab_groups",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//chrome/browser",
    "//chrome/browser/favicon",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/sync",
    "//chrome/browser/sync:factories",
    "//chrome/browser/tab_group_sync:factories",
    "//chrome/browser/ui",
    "//chrome/browser/ui:browser_element_identifiers",
    "//chrome/browser/ui:ui_features",
    "//chrome/browser/ui/browser_window",
    "//chrome/browser/ui/tabs:tab_group",
    "//chrome/browser/ui/tabs:tab_strip",
    "//chrome/browser/ui/tabs:tabs_public",
    "//chrome/browser/ui/toasts",
    "//chrome/browser/ui/views/frame",
    "//chrome/common",
    "//chrome/common:channel_info",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//components/collaboration/public",
    "//components/collaboration/public:empty_messaging_backend_service",
    "//components/data_sharing/public:features",
    "//components/keyed_service/content",
    "//components/keyed_service/core",
    "//components/prefs",
    "//components/saved_tab_groups/internal",
    "//components/saved_tab_groups/internal:model",
    "//components/saved_tab_groups/internal:service_test_utils",
    "//components/saved_tab_groups/public",
    "//components/saved_tab_groups/public:features",
    "//components/sync/base",
    "//components/sync/model",
    "//components/sync_device_info",
    "//components/tab_groups",
    "//components/tabs:public",
    "//content/public/browser",
    "//content/test:test_support",
    "//net:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/views",
    "//url",
  ]
}

source_set("test_support") {
  sources = [
    "tab_group_sync_service_initialized_observer.cc",
    "tab_group_sync_service_initialized_observer.h",
  ]
  public_deps = [
    "//base",
    "//components/saved_tab_groups/public",
  ]
}