chromium/ios/chrome/browser/shared/model/browser_state/BUILD.gn

# Copyright 2023 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") {
  sources = [
    "browser_state_info_cache.h",
    "browser_state_otr_helper.cc",
    "browser_state_otr_helper.h",
    "chrome_browser_state.h",
    "chrome_browser_state.mm",
    "chrome_browser_state_manager_observer.h",
  ]

  public_deps = [
    "//ios/web/public",
    "//net",
  ]

  deps = [
    "//base",
    "//components/autofill/core/browser",
    "//components/keyed_service/core",
    "//components/keyed_service/ios",
    "//components/prefs",
    "//components/search_engines",
    "//components/sync_preferences",
    "//components/variations/net",
    "//components/webdata_services",
    "//ios/chrome/browser/net/model:net_types",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/model/url:constants",
    "//ios/components/webui:url_constants",
    "//ios/web/public/webui",
    "//ios/web/webui",
  ]

  # TODO(crbug.com/358267438): Remove once forwarding headers are removed.
  allow_circular_includes_from = [ "//ios/chrome/browser/shared/model/profile" ]
}

source_set("incognito_session_tracker") {
  sources = [
    "incognito_session_tracker.h",
    "incognito_session_tracker.mm",
  ]
  deps = [
    ":browser_state",
    "//base",
    "//ios/chrome/browser/shared/model/browser",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/model/web_state_list",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "chrome_browser_state_unittest.cc",
    "incognito_session_tracker_unittest.mm",
  ]
  deps = [
    ":browser_state",
    ":incognito_session_tracker",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/prefs:test_support",
    "//components/variations/net",
    "//ios/chrome/browser/shared/model/browser",
    "//ios/chrome/browser/shared/model/browser/test:test_support",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/model/profile/test",
    "//ios/chrome/browser/shared/model/web_state_list",
    "//ios/chrome/test:test_support",
    "//ios/web/public/test",
    "//testing/gtest",
  ]
}

source_set("test_support") {
  testonly = true
  sources = [
    "test_chrome_browser_state.h",
    "test_chrome_browser_state_manager.h",
  ]

  public_deps = [
    ":browser_state",
    "//base",
    "//components/signin/core/browser",
    "//third_party/abseil-cpp:absl",
  ]

  deps = [
    "//base",
    "//components/keyed_service/core",
    "//components/keyed_service/ios",
    "//components/profile_metrics",
    "//components/supervised_user/core/browser",
    "//components/supervised_user/core/common:buildflags",
    "//components/sync_preferences",
    "//components/sync_preferences:test_support",
    "//components/undo",
    "//components/user_prefs",
    "//components/webdata_services",
    "//ios/chrome/browser/browser_state/model",
    "//ios/chrome/browser/browser_state/model:constants",
    "//ios/chrome/browser/net/model",
    "//ios/chrome/browser/ntp/ui_bundled:logo",
    "//ios/chrome/browser/policy/model:model",
    "//ios/chrome/browser/prefs/model",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/prefs:browser_prefs",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/model/profile/test",
    "//ios/chrome/browser/supervised_user/model:sync_settings_factory",
    "//ios/chrome/browser/webdata_services/model",
    "//ios/chrome/test:test_support",
    "//ios/web/public",
    "//net:test_support",
  ]

  # TODO(crbug.com/358267438): Remove once forwarding headers are removed.
  allow_circular_includes_from =
      [ "//ios/chrome/browser/shared/model/profile/test" ]
}