# Copyright 2016 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/chromeos/ui_mode.gni")
import("//extensions/buildflags/buildflags.gni")
assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")
import("//build/config/features.gni")
source_set("networking_private") {
# Sources that will be added if a non-stub implementation is chosen.
default_sources = [
"networking_private_api.cc",
"networking_private_api.h",
"networking_private_delegate.cc",
"networking_private_delegate.h",
"networking_private_delegate_factory.cc",
"networking_private_delegate_factory.h",
"networking_private_delegate_observer.h",
"networking_private_event_router.h",
"networking_private_event_router_factory.cc",
"networking_private_event_router_factory.h",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
"//build:chromeos_buildflags",
"//components/keyed_service/content",
"//components/onc",
"//content/public/browser",
"//extensions/common",
"//extensions/common/api",
"//net",
]
public_deps = [ "//extensions/browser:browser_sources" ]
if (is_chromeos_lacros) {
sources = default_sources + [
"lacros_networking_private_observer.cc",
"lacros_networking_private_observer.h",
"networking_private_event_router_nonchromeos.cc",
"networking_private_lacros.cc",
"networking_private_lacros.h",
]
deps += [
"//chromeos/crosapi/mojom",
"//chromeos/lacros",
]
} else if (is_linux && use_dbus) {
sources = default_sources + [
"network_config_dbus_constants_linux.cc",
"network_config_dbus_constants_linux.h",
"networking_private_event_router_nonchromeos.cc",
"networking_private_linux.cc",
"networking_private_linux.h",
]
deps += [ "//dbus" ]
} else if (is_win || is_mac || is_fuchsia) {
sources = default_sources + [
"networking_private_event_router_nonchromeos.cc",
"networking_private_service_client.cc",
"networking_private_service_client.h",
]
deps += [ "//components/wifi" ]
} else if (is_chromeos_ash) {
sources = default_sources + [
"networking_private_chromeos.cc",
"networking_private_chromeos.h",
"networking_private_event_router_chromeos.cc",
]
deps += [
"//chromeos/ash/components/login/login_state",
"//chromeos/ash/components/network",
"//chromeos/ash/components/network/portal_detector",
"//chromeos/components/onc",
"//components/proxy_config",
]
} else {
not_needed([ "default_sources" ])
sources = [ "networking_private_stubs.cc" ]
}
}