chromium/chrome/browser/google/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.

import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")

assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome")

source_set("google") {
  sources = [
    "google_brand.cc",
    "google_brand.h",
  ]

  public_deps = [ "//chrome/browser:browser_public_dependencies" ]

  deps = [
    "//base",
    "//chrome/common:constants",
    "//components/prefs:prefs",
    "//content/public/browser",
  ]

  if (is_chromeos_ash) {
    sources += [
      "google_brand_chromeos.cc",
      "google_brand_chromeos.h",
      "google_brand_code_map_chromeos.cc",
      "google_brand_code_map_chromeos.h",
    ]

    deps += [
      "//chrome/browser:browser_process",
      "//chrome/browser/ash/policy/core",
      "//chromeos/ash/components/system:system",
      "//components/policy/core/common:common_constants",
    ]
  }

  if (is_win) {
    sources += [
      "did_run_updater_win.cc",
      "did_run_updater_win.h",
    ]
    if (is_chrome_branded) {
      sources += [
        "google_update_policy_fetcher_win.cc",
        "google_update_policy_fetcher_win.h",
        "google_update_policy_fetcher_win_util.cc",
        "google_update_policy_fetcher_win_util.h",
        "google_update_win.cc",
        "google_update_win.h",
        "switches.cc",
        "switches.h",
      ]

      deps += [ "//chrome/updater/app/server/win:updater_legacy_idl" ]
    }

    deps += [
      "//chrome/app:generated_resources_grit",
      "//chrome/common",
      "//chrome/install_static:install_static_util",
      "//chrome/installer/util:with_no_strings",
      "//components/policy/core/browser",
      "//components/policy/core/common",
    ]
  }

  if (is_mac) {
    sources += [ "google_brand_mac.mm" ]
    deps += [ "//chrome/common:channel_info" ]
  }

  if (is_posix) {
    sources += [ "google_update_settings_posix.cc" ]
  }
  if (is_posix) {
    deps += [ "//components/crash/core/app" ]
  }
}

source_set("unit_tests") {
  testonly = true

  sources = [ "google_update_settings_unittest.cc" ]

  deps = [
    ":google",
    "//base",
    "//base/test:test_support",
    "//chrome/common:constants",
    "//chrome/installer/util:with_no_strings",
    "//content/test:test_support",
    "//testing/gtest:gtest",
  ]

  if (is_chromeos_ash) {
    sources += [ "google_brand_code_map_chromeos_unittest.cc" ]
  }

  if (is_win && is_chrome_branded) {
    sources += [
      "google_update_policy_fetcher_win_util_unittest.cc",
      "google_update_win_unittest.cc",
    ]

    deps += [
      "//chrome/common:version_header",
      "//chrome/install_static/test:test_support",
      "//chrome/updater/app/server/win:updater_legacy_idl",
      "//components/policy/core/common",
    ]
  }
}