chromium/ios/chrome/browser/ui/settings/notifications/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("notifications") {
  sources = [
    "notifications_coordinator.h",
    "notifications_coordinator.mm",
    "notifications_mediator.h",
    "notifications_mediator.mm",
  ]
  deps = [
    ":constants",
    ":notifications_ui",
    ":utils",
    "//base",
    "//components/prefs",
    "//ios/chrome/app/strings",
    "//ios/chrome/browser/content_notification/model:util",
    "//ios/chrome/browser/push_notification/model:browser_state_service",
    "//ios/chrome/browser/push_notification/model:browser_state_service_factory",
    "//ios/chrome/browser/push_notification/model:push_notification_client",
    "//ios/chrome/browser/push_notification/model:push_notification_service",
    "//ios/chrome/browser/push_notification/model:push_notification_service_header",
    "//ios/chrome/browser/shared/coordinator/alert",
    "//ios/chrome/browser/shared/coordinator/chrome_coordinator",
    "//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/profile",
    "//ios/chrome/browser/shared/public/features:features",
    "//ios/chrome/browser/shared/ui/list_model",
    "//ios/chrome/browser/shared/ui/symbols",
    "//ios/chrome/browser/shared/ui/table_view",
    "//ios/chrome/browser/shared/ui/table_view:utils",
    "//ios/chrome/browser/shared/ui/table_view/cells",
    "//ios/chrome/browser/signin/model",
    "//ios/chrome/browser/ui/content_suggestions:content_suggestions_ui_util",
    "//ios/chrome/browser/ui/push_notification:notifications_opt_in_ui",
    "//ios/chrome/browser/ui/push_notification:opt_in_alert_coordinator",
    "//ios/chrome/browser/ui/push_notification:presenters",
    "//ios/chrome/browser/ui/settings/notifications/content_notifications",
    "//ios/chrome/browser/ui/settings/notifications/tracking_price",
    "//ios/chrome/common/ui/colors",
    "//ui/base",
  ]
}

source_set("notifications_ui") {
  sources = [
    "notifications_banner_view_controller.h",
    "notifications_banner_view_controller.mm",
    "notifications_consumer.h",
    "notifications_item_identifier.h",
    "notifications_navigation_commands.h",
    "notifications_view_controller.h",
    "notifications_view_controller.mm",
    "notifications_view_controller_delegate.h",
    "tips_notifications_alert_presenter.h",
  ]
  deps = [
    ":constants",
    "//ios/chrome/app/strings",
    "//ios/chrome/browser/commerce/model/push_notification",
    "//ios/chrome/browser/shared/public/features",
    "//ios/chrome/browser/shared/ui/list_model",
    "//ios/chrome/browser/shared/ui/symbols",
    "//ios/chrome/browser/shared/ui/table_view",
    "//ios/chrome/browser/shared/ui/table_view:utils",
    "//ios/chrome/browser/shared/ui/util",
    "//ios/chrome/browser/ui/push_notification:notifications_opt_in_ui",
    "//ios/chrome/browser/ui/settings:settings_root",
    "//ios/chrome/common/ui/colors",
    "//ios/chrome/common/ui/elements",
    "//ios/chrome/common/ui/promo_style",
    "//ui/base",
  ]
}

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

source_set("utils") {
  sources = [
    "notifications_settings_observer.h",
    "notifications_settings_observer.mm",
  ]
  deps = [
    "//components/commerce/core:pref_names",
    "//components/prefs",
    "//components/prefs/ios:ios",
    "//ios/chrome/browser/push_notification/model:constants",
    "//ios/chrome/browser/push_notification/model:push_notification_client",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "notifications_settings_observer_unittest.mm" ]
  deps = [
    ":notifications_ui",
    ":utils",
    "//base/test:test_support",
    "//components/commerce/core:pref_names",
    "//components/prefs",
    "//components/prefs:test_support",
    "//ios/chrome/browser/push_notification/model:constants",
    "//ios/chrome/browser/push_notification/model:push_notification_client",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//third_party/ocmock",
  ]
  frameworks = [ "UIKit.framework" ]
}

source_set("eg2_tests") {
  configs += [ "//build/config/ios:xctest_config" ]
  testonly = true
  sources = [ "notifications_egtest.mm" ]
  deps = [
    ":constants",
    "//base",
    "//base/test:test_support",
    "//components/commerce/core:feature_list",
    "//components/variations",
    "//ios/chrome/app/strings",
    "//ios/chrome/browser/ui/push_notification:test_support",
    "//ios/chrome/test/earl_grey:eg_test_support+eg2",
    "//ios/testing/earl_grey:eg_test_support+eg2",
    "//ui/base",
  ]
  frameworks = [ "UIKit.framework" ]
}