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

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

source_set("browser_state_service") {
  sources = [
    "push_notification_profile_service.h",
    "push_notification_profile_service.mm",
  ]
  deps = [
    ":push_notification_client",
    ":push_notification_service",
    ":push_notification_service_header",
    "//base",
    "//components/keyed_service/core",
    "//components/prefs",
    "//components/signin/public/identity_manager",
    "//ios/chrome/browser/commerce/model",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//ios/web/public/thread",
  ]
}

source_set("browser_state_service_factory") {
  sources = [
    "push_notification_profile_service_factory.h",
    "push_notification_profile_service_factory.mm",
  ]

  deps = [
    ":browser_state_service",
    ":push_notification_service",
    ":push_notification_service_header",
    "//base",
    "//components/keyed_service/ios",
    "//ios/chrome/browser/commerce/model",
    "//ios/chrome/browser/commerce/model/push_notification",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/signin/model",
  ]
}

source_set("push_notification_service_header") {
  sources = [ "push_notification_service.h" ]
}

source_set("push_notification_service") {
  sources = [
    "provisional_push_notification_util.h",
    "provisional_push_notification_util.mm",
    "push_notification_account_context_manager.h",
    "push_notification_account_context_manager.mm",
    "push_notification_client_manager.h",
    "push_notification_client_manager.mm",
    "push_notification_configuration.h",
    "push_notification_configuration.mm",
    "push_notification_delegate.h",
    "push_notification_delegate.mm",
    "push_notification_service.mm",
    "push_notification_settings_util.h",
    "push_notification_settings_util.mm",
    "push_notification_util.h",
    "push_notification_util.mm",
  ]
  deps = [
    ":constants",
    ":push_notification_client",
    ":push_notification_service_header",
    "//base",
    "//components/commerce/core:pref_names",
    "//components/optimization_guide/core:features",
    "//components/pref_registry",
    "//components/prefs",
    "//components/search_engines",
    "//components/send_tab_to_self",
    "//components/sync_device_info",
    "//ios/chrome/app/application_delegate:app_state_header",
    "//ios/chrome/app/startup:startup_basic",
    "//ios/chrome/browser/commerce/model/push_notification",
    "//ios/chrome/browser/content_notification/model:content_notification_client",
    "//ios/chrome/browser/content_notification/model:content_notification_nau_configuration",
    "//ios/chrome/browser/content_notification/model:content_notification_service",
    "//ios/chrome/browser/content_notification/model:content_notification_service_factory",
    "//ios/chrome/browser/content_notification/model:util",
    "//ios/chrome/browser/safety_check_notifications/model:notification_client",
    "//ios/chrome/browser/search_engines/model:template_url_service_factory",
    "//ios/chrome/browser/shared/coordinator/scene:scene_state_header",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/public/features:features",
    "//ios/chrome/browser/signin/model",
    "//ios/chrome/browser/sync/model:device_info_sync_service_factory",
    "//ios/chrome/browser/tips_notifications/model:client",
    "//ios/chrome/common/app_group",
  ]
}

source_set("push_notification_client") {
  sources = [
    "push_notification_client.h",
    "push_notification_client.mm",
    "push_notification_client_id.h",
  ]
  public_deps = [
    "//base",
    "//ios/chrome/browser/shared/model/browser_state",
    "//url:url",
  ]
  deps = [
    "//ios/chrome/browser/shared/coordinator/scene:scene_state_header",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/public/commands",
    "//ios/chrome/browser/url_loading/model",
    "//ios/public/provider/chrome/browser/user_feedback:user_feedback_api",
  ]
}

source_set("constants") {
  sources = [
    "constants.h",
    "constants.mm",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "push_notification_account_context_manager+testing.h",
    "push_notification_account_context_manager_unittest.mm",
    "push_notification_client_manager_unittest.mm",
    "push_notification_settings_util_unittest.mm",
    "push_notification_util+testing.h",
    "push_notification_util_unittest.mm",
  ]
  deps = [
    ":push_notification_client",
    ":push_notification_service",
    ":push_notification_service_header",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/commerce/core:pref_names",
    "//components/prefs",
    "//components/prefs:test_support",
    "//components/sync_preferences:test_support",
    "//ios/chrome/browser/push_notification/model:constants",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/model/profile/test",
    "//ios/chrome/browser/shared/public/features:features",
    "//ios/chrome/browser/signin/model:fake_system_identity",
    "//ios/chrome/test:test_support",
    "//ios/web/public/test",
    "//testing/gtest",
  ]
}

source_set("test_support") {
  sources = [
    "test_push_notification_client.h",
    "test_push_notification_client.mm",
  ]

  deps = [
    ":push_notification_client",
    ":push_notification_service",
    "//base",
  ]
}