0

Migrate //chromeos/ash/components/network to namespace ash [9/N]

This CL migrates remaining files to namespace ash from chromeos.

This CL is part of the Chrome OS source code directory migration:
https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.

Bug: 1164001
Change-Id: If75617355585da7891a52236dc8b472d561eb227
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3815105
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
Owners-Override: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032884}
This commit is contained in:
Yeunjoo Choi
2022-08-09 06:11:08 +00:00
committed by Chromium LUCI CQ
parent f888fd2a61
commit 427ff7a6d3
105 changed files with 292 additions and 356 deletions
ash
chrome/browser
chromeos
components/proxy_config
content/browser/renderer_host/pepper
extensions/browser/api/socket

@@ -83,7 +83,7 @@ ash::NetworkProfileHandler* GetNetworkProfileHandler() {
return chromeos::NetworkHandler::Get()->network_profile_handler(); return chromeos::NetworkHandler::Get()->network_profile_handler();
} }
const chromeos::NetworkProfile* GetNetworkProfile() { const ash::NetworkProfile* GetNetworkProfile() {
return GetNetworkProfileHandler()->GetProfileForUserhash( return GetNetworkProfileHandler()->GetProfileForUserhash(
chromeos::LoginState::Get()->primary_user_hash()); chromeos::LoginState::Get()->primary_user_hash());
} }

@@ -11,8 +11,6 @@
// TODO(https://crbug.com/1164001): move to forward declaration // TODO(https://crbug.com/1164001): move to forward declaration
#include "ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "ash/services/secure_channel/public/cpp/client/secure_channel_client.h"
// TODO(https://crbug.com/1164001): move to forward declaration // TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_connect.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_state_handler.h" #include "chromeos/ash/components/network/network_state_handler.h"
class PrefService; class PrefService;
@@ -27,6 +25,7 @@ namespace device_sync {
class DeviceSyncClient; class DeviceSyncClient;
} }
class NetworkConnect;
class NetworkConnectionHandler; class NetworkConnectionHandler;
namespace tether { namespace tether {

@@ -13,8 +13,6 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
// TODO(https://crbug.com/1164001): move to forward declaration // TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_connect.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_state_handler.h" #include "chromeos/ash/components/network/network_state_handler.h"
#include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_registry_simple.h"
#include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_adapter.h"
@@ -36,6 +34,7 @@ class DeviceSyncClient;
} }
class ManagedNetworkConfigurationHandler; class ManagedNetworkConfigurationHandler;
class NetworkConnect;
class NetworkConnectionHandler; class NetworkConnectionHandler;
namespace tether { namespace tether {

@@ -14,10 +14,6 @@
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "base/values.h" #include "base/values.h"
// TODO(https://crbug.com/1164001): move to forward declaration // TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_connect.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_state.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_state_handler.h" #include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_state_handler_observer.h" #include "chromeos/ash/components/network/network_state_handler_observer.h"
@@ -27,6 +23,9 @@ class TaskRunner;
namespace ash { namespace ash {
class NetworkConnect;
class NetworkState;
namespace tether { namespace tether {
// Connects to a Wi-Fi hotspot, given an SSID and password. // Connects to a Wi-Fi hotspot, given an SSID and password.

@@ -9,8 +9,6 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chromeos/ash/components/dbus/hermes/hermes_profile_client.h" #include "chromeos/ash/components/dbus/hermes/hermes_profile_client.h"
#include "chromeos/ash/components/dbus/hermes/hermes_response_status.h" #include "chromeos/ash/components/dbus/hermes/hermes_response_status.h"
// TODO(https://crbug.com/1164001): move to forward declaration.
#include "chromeos/ash/components/network/cellular_esim_profile.h"
#include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/cellular_inhibitor.h"
#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/receiver_set.h"
@@ -18,7 +16,11 @@ namespace dbus {
class ObjectPath; class ObjectPath;
} }
namespace ash::cellular_setup { namespace ash {
class CellularESimProfile;
namespace cellular_setup {
class Euicc; class Euicc;
class ESimManager; class ESimManager;
@@ -117,6 +119,7 @@ class ESimProfile : public mojom::ESimProfile {
base::WeakPtrFactory<ESimProfile> weak_ptr_factory_{this}; base::WeakPtrFactory<ESimProfile> weak_ptr_factory_{this};
}; };
} // namespace ash::cellular_setup } // namespace cellular_setup
} // namespace ash
#endif // ASH_SERVICES_CELLULAR_SETUP_ESIM_PROFILE_H_ #endif // ASH_SERVICES_CELLULAR_SETUP_ESIM_PROFILE_H_

@@ -9,8 +9,6 @@
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "chromeos/ash/components/dbus/hermes/hermes_euicc_client.h" #include "chromeos/ash/components/dbus/hermes/hermes_euicc_client.h"
#include "chromeos/ash/components/dbus/hermes/hermes_profile_client.h" #include "chromeos/ash/components/dbus/hermes/hermes_profile_client.h"
// TODO(https://crbug.com/1164001): move to forward declaration.
#include "chromeos/ash/components/network/cellular_esim_profile.h"
#include "chromeos/ash/components/network/cellular_inhibitor.h" #include "chromeos/ash/components/network/cellular_inhibitor.h"
#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/receiver_set.h"
@@ -18,7 +16,11 @@ namespace dbus {
class ObjectPath; class ObjectPath;
} }
namespace ash::cellular_setup { namespace ash {
class CellularESimProfile;
namespace cellular_setup {
class ESimProfile; class ESimProfile;
class ESimManager; class ESimManager;
@@ -114,6 +116,7 @@ class Euicc : public mojom::Euicc {
base::WeakPtrFactory<Euicc> weak_ptr_factory_{this}; base::WeakPtrFactory<Euicc> weak_ptr_factory_{this};
}; };
} // namespace ash::cellular_setup } // namespace cellular_setup
} // namespace ash
#endif // ASH_SERVICES_CELLULAR_SETUP_EUICC_H_ #endif // ASH_SERVICES_CELLULAR_SETUP_EUICC_H_

@@ -46,9 +46,9 @@ class AutoConnectNotifierTest : public AshTestBase {
~AutoConnectNotifierTest() override = default; ~AutoConnectNotifierTest() override = default;
void SetUp() override { void SetUp() override {
chromeos::SystemTokenCertDbStorage::Initialize(); SystemTokenCertDbStorage::Initialize();
chromeos::NetworkCertLoader::Initialize(); NetworkCertLoader::Initialize();
chromeos::NetworkCertLoader::ForceAvailableForNetworkAuthForTesting(); NetworkCertLoader::ForceAvailableForNetworkAuthForTesting();
network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>();
CHECK(chromeos::NetworkHandler::Get()->auto_connect_handler()); CHECK(chromeos::NetworkHandler::Get()->auto_connect_handler());
network_config_helper_ = std::make_unique< network_config_helper_ = std::make_unique<
@@ -75,8 +75,8 @@ class AutoConnectNotifierTest : public AshTestBase {
AshTestBase::TearDown(); AshTestBase::TearDown();
network_config_helper_.reset(); network_config_helper_.reset();
network_handler_test_helper_.reset(); network_handler_test_helper_.reset();
chromeos::NetworkCertLoader::Shutdown(); NetworkCertLoader::Shutdown();
chromeos::SystemTokenCertDbStorage::Shutdown(); SystemTokenCertDbStorage::Shutdown();
} }
void NotifyConnectToNetworkRequested() { void NotifyConnectToNetworkRequested() {

@@ -43,8 +43,8 @@ class CellularSetupNotifierTest : public NoSessionAshTestBase {
~CellularSetupNotifierTest() override = default; ~CellularSetupNotifierTest() override = default;
void SetUp() override { void SetUp() override {
chromeos::SystemTokenCertDbStorage::Initialize(); SystemTokenCertDbStorage::Initialize();
chromeos::NetworkCertLoader::Initialize(); NetworkCertLoader::Initialize();
chromeos::shill_clients::InitializeFakes(); chromeos::shill_clients::InitializeFakes();
hermes_clients::InitializeFakes(); hermes_clients::InitializeFakes();
chromeos::NetworkHandler::Initialize(); chromeos::NetworkHandler::Initialize();
@@ -69,8 +69,8 @@ class CellularSetupNotifierTest : public NoSessionAshTestBase {
chromeos::NetworkHandler::Shutdown(); chromeos::NetworkHandler::Shutdown();
hermes_clients::Shutdown(); hermes_clients::Shutdown();
chromeos::shill_clients::Shutdown(); chromeos::shill_clients::Shutdown();
chromeos::NetworkCertLoader::Shutdown(); NetworkCertLoader::Shutdown();
chromeos::SystemTokenCertDbStorage::Shutdown(); SystemTokenCertDbStorage::Shutdown();
} }
// Returns the cellular setup notification if it is shown, and null if it is // Returns the cellular setup notification if it is shown, and null if it is

@@ -181,7 +181,7 @@ void NetworkDetailedViewController::OnNetworkListItemSelected(
UserMetricsAction("StatusArea_Network_ConnectConfigured")); UserMetricsAction("StatusArea_Network_ConnectConfigured"));
LogUserNetworkEvent(*network.get()); LogUserNetworkEvent(*network.get());
RecordNetworkRowClickedAction(NetworkRowClickedAction::kConnectToNetwork); RecordNetworkRowClickedAction(NetworkRowClickedAction::kConnectToNetwork);
chromeos::NetworkConnect::Get()->ConnectToNetworkId(network->guid); NetworkConnect::Get()->ConnectToNetworkId(network->guid);
return; return;
} }
} }

@@ -58,7 +58,7 @@ constexpr char kNetworkConnectionDetails[] =
const std::string kNetworkTechnologyWiFi = "WiFi"; const std::string kNetworkTechnologyWiFi = "WiFi";
const std::string kNetworkTechnologyMobile = "Mobile"; const std::string kNetworkTechnologyMobile = "Mobile";
class NetworkConnectTestDelegate : public chromeos::NetworkConnect::Delegate { class NetworkConnectTestDelegate : public NetworkConnect::Delegate {
public: public:
NetworkConnectTestDelegate() {} NetworkConnectTestDelegate() {}
@@ -96,7 +96,7 @@ class NetworkDetailedViewControllerTest : public AshTestBase {
// Creating a service here, since we would be testing that wifi, // Creating a service here, since we would be testing that wifi,
// networks which can be connected to are actually connected to. This // networks which can be connected to are actually connected to. This
// checks that chromeos::NetworkConnect eventually connects us to the // checks that NetworkConnect eventually connects us to the
// network. // network.
wifi_service_path_ = wifi_service_path_ =
network_state_helper()->ConfigureService(base::StringPrintf( network_state_helper()->ConfigureService(base::StringPrintf(
@@ -106,7 +106,7 @@ class NetworkDetailedViewControllerTest : public AshTestBase {
kWifi)); kWifi));
network_connect_delegate_ = std::make_unique<NetworkConnectTestDelegate>(); network_connect_delegate_ = std::make_unique<NetworkConnectTestDelegate>();
chromeos::NetworkConnect::Initialize(network_connect_delegate_.get()); NetworkConnect::Initialize(network_connect_delegate_.get());
AshTestBase::SetUp(); AshTestBase::SetUp();
feature_list_.InitAndEnableFeature(features::kQuickSettingsNetworkRevamp); feature_list_.InitAndEnableFeature(features::kQuickSettingsNetworkRevamp);
@@ -119,7 +119,7 @@ class NetworkDetailedViewControllerTest : public AshTestBase {
void TearDown() override { void TearDown() override {
network_detailed_view_controller_.reset(); network_detailed_view_controller_.reset();
AshTestBase::TearDown(); AshTestBase::TearDown();
chromeos::NetworkConnect::Shutdown(); NetworkConnect::Shutdown();
chromeos::NetworkHandler::Shutdown(); chromeos::NetworkHandler::Shutdown();
network_connect_delegate_.reset(); network_connect_delegate_.reset();
} }

@@ -297,7 +297,7 @@ void NetworkStateListDetailedView::HandleViewClickedImpl(
RecordNetworkRowClickedAction( RecordNetworkRowClickedAction(
NetworkRowClickedAction::kConnectToNetwork); NetworkRowClickedAction::kConnectToNetwork);
} }
chromeos::NetworkConnect::Get()->ConnectToNetworkId(network->guid); NetworkConnect::Get()->ConnectToNetworkId(network->guid);
return; return;
} }
} }

@@ -290,9 +290,8 @@ void VPNListNetworkEntry::UpdateFromNetworkState(
if (IsVpnConfigAllowed()) { if (IsVpnConfigAllowed()) {
disconnect_button_ = TrayPopupUtils::CreateTrayPopupButton( disconnect_button_ = TrayPopupUtils::CreateTrayPopupButton(
// TODO(stevenjb): Replace with mojo API. https://crbug.com/862420. // TODO(stevenjb): Replace with mojo API. https://crbug.com/862420.
base::BindRepeating( base::BindRepeating(&NetworkConnect::DisconnectFromNetworkId,
&chromeos::NetworkConnect::DisconnectFromNetworkId, base::Unretained(NetworkConnect::Get()), guid_),
base::Unretained(chromeos::NetworkConnect::Get()), guid_),
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VPN_DISCONNECT)); l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VPN_DISCONNECT));
disconnect_button_->SetAccessibleName(l10n_util::GetStringFUTF16( disconnect_button_->SetAccessibleName(l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_NETWORK_DISCONNECT_BUTTON_A11Y_LABEL, label)); IDS_ASH_STATUS_TRAY_NETWORK_DISCONNECT_BUTTON_A11Y_LABEL, label));

@@ -546,7 +546,7 @@ void CertStoreServiceTest::CheckInstalledCerts(
std::string hex_encoded_id = std::string hex_encoded_id =
base::HexEncode(cert_id.data(), cert_id.size()); base::HexEncode(cert_id.data(), cert_id.size());
EXPECT_EQ(hex_encoded_id, EXPECT_EQ(hex_encoded_id,
chromeos::NetworkCertLoader::GetPkcs11IdAndSlotForCert( ash::NetworkCertLoader::GetPkcs11IdAndSlotForCert(
nss_cert.get(), &slot_id)); nss_cert.get(), &slot_id));
EXPECT_TRUE(PlaceholdersContainIdAndSlot(cert_id, cert.test_data.slot)); EXPECT_TRUE(PlaceholdersContainIdAndSlot(cert_id, cert.test_data.slot));
break; break;

@@ -568,7 +568,7 @@ void ArcSettingsServiceImpl::SyncLocationServiceEnabled() const {
// multi-network support so we should sync per-network proxy configuration. // multi-network support so we should sync per-network proxy configuration.
void ArcSettingsServiceImpl::SyncProxySettings() const { void ArcSettingsServiceImpl::SyncProxySettings() const {
std::unique_ptr<ProxyConfigDictionary> proxy_config_dict = std::unique_ptr<ProxyConfigDictionary> proxy_config_dict =
chromeos::ProxyConfigServiceImpl::GetActiveProxyConfigDictionary( ash::ProxyConfigServiceImpl::GetActiveProxyConfigDictionary(
GetPrefs(), g_browser_process->local_state()); GetPrefs(), g_browser_process->local_state());
ProxyPrefs::ProxyMode mode; ProxyPrefs::ProxyMode mode;

@@ -306,8 +306,7 @@ class ArcSettingsServiceTest : public InProcessBrowserTest {
->network_state_handler() ->network_state_handler()
->GetNetworkState(service_path); ->GetNetworkState(service_path);
ASSERT_TRUE(network); ASSERT_TRUE(network);
chromeos::proxy_config::SetProxyConfigForNetwork(proxy_config_dict, ash::proxy_config::SetProxyConfigForNetwork(proxy_config_dict, *network);
*network);
} }
std::unique_ptr<FakeIntentHelperInstance> fake_intent_helper_instance_; std::unique_ptr<FakeIntentHelperInstance> fake_intent_helper_instance_;
@@ -608,7 +607,7 @@ IN_PROC_BROWSER_TEST_F(ArcSettingsServiceTest, TwoSourcesTest) {
->network_state_handler() ->network_state_handler()
->DefaultNetwork(); ->DefaultNetwork();
ASSERT_TRUE(network); ASSERT_TRUE(network);
chromeos::proxy_config::SetProxyConfigForNetwork(proxy_config_dict, *network); ash::proxy_config::SetProxyConfigForNetwork(proxy_config_dict, *network);
RunUntilIdle(); RunUntilIdle();
base::Value expected_proxy_config(base::Value::Type::DICTIONARY); base::Value expected_proxy_config(base::Value::Type::DICTIONARY);

@@ -194,8 +194,8 @@ void NetworkSettingsServiceAsh::DetermineEffectiveProxy() {
if (!pref_service) if (!pref_service)
return; return;
crosapi::mojom::ProxyConfigPtr new_proxy_config = ProxyConfigToCrosapiProxy( crosapi::mojom::ProxyConfigPtr new_proxy_config = ProxyConfigToCrosapiProxy(
chromeos::ProxyConfigServiceImpl::GetActiveProxyConfigDictionary( ash::ProxyConfigServiceImpl::GetActiveProxyConfigDictionary(pref_service,
pref_service, local_state_) local_state_)
.get(), .get(),
cached_wpad_url_); cached_wpad_url_);

@@ -208,7 +208,7 @@ void VpnServiceForExtensionAsh::CreateConfiguration(
// Since the API is only designed to be used with the primary profile, it's // Since the API is only designed to be used with the primary profile, it's
// safe to get the hash of the primary profile here. // safe to get the hash of the primary profile here.
const chromeos::NetworkProfile* profile = const ash::NetworkProfile* profile =
chromeos::NetworkHandler::Get() chromeos::NetworkHandler::Get()
->network_profile_handler() ->network_profile_handler()
->GetProfileForUserhash(ash::ProfileHelper::GetUserIdHashFromProfile( ->GetProfileForUserhash(ash::ProfileHelper::GetUserIdHashFromProfile(

@@ -722,8 +722,7 @@ class ProxyAuthLockscreenWebUiTest : public LockscreenWebUiTest {
ASSERT_EQ(network->guid(), ASSERT_EQ(network->guid(),
FakeShillManagerClient::kFakeEthernetNetworkGuid); FakeShillManagerClient::kFakeEthernetNetworkGuid);
chromeos::proxy_config::SetProxyConfigForNetwork(proxy_config_dict, proxy_config::SetProxyConfigForNetwork(proxy_config_dict, *network);
*network);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }

@@ -119,8 +119,6 @@
namespace ash { namespace ash {
namespace { namespace {
// TODO(https://crbug.com/1164001): remove after the class is migrated
using ::chromeos::ProxyConfigServiceImpl;
using ::content::BrowserThread; using ::content::BrowserThread;
// A string pref that gets set when a device local account is removed but a // A string pref that gets set when a device local account is removed but a

@@ -257,8 +257,8 @@ void BrowserPolicyConnectorAsh::Init(
ash::CrosSettings::Get(), ash::CrosSettings::Get(),
DeviceNetworkConfigurationUpdaterAsh::DeviceAssetIDFetcher()); DeviceNetworkConfigurationUpdaterAsh::DeviceAssetIDFetcher());
// NetworkCertLoader may be not initialized in tests. // NetworkCertLoader may be not initialized in tests.
if (chromeos::NetworkCertLoader::IsInitialized()) { if (ash::NetworkCertLoader::IsInitialized()) {
chromeos::NetworkCertLoader::Get()->SetDevicePolicyCertificateProvider( ash::NetworkCertLoader::Get()->SetDevicePolicyCertificateProvider(
device_network_configuration_updater_.get()); device_network_configuration_updater_.get());
} }
@@ -345,9 +345,8 @@ void BrowserPolicyConnectorAsh::Shutdown() {
system_proxy_handler_.reset(); system_proxy_handler_.reset();
// NetworkCertLoader may be not initialized in tests. // NetworkCertLoader may be not initialized in tests.
if (chromeos::NetworkCertLoader::IsInitialized()) { if (ash::NetworkCertLoader::IsInitialized()) {
chromeos::NetworkCertLoader::Get()->SetDevicePolicyCertificateProvider( ash::NetworkCertLoader::Get()->SetDevicePolicyCertificateProvider(nullptr);
nullptr);
} }
device_network_configuration_updater_.reset(); device_network_configuration_updater_.reset();

@@ -2163,7 +2163,7 @@ IN_PROC_BROWSER_TEST_F(DeviceLocalAccountWarnings, NoLoginWarningShown) {
class ManagedSessionsTest : public DeviceLocalAccountTest { class ManagedSessionsTest : public DeviceLocalAccountTest {
protected: protected:
class CertsObserver : public chromeos::PolicyCertificateProvider::Observer { class CertsObserver : public ash::PolicyCertificateProvider::Observer {
public: public:
explicit CertsObserver(base::OnceClosure on_change) explicit CertsObserver(base::OnceClosure on_change)
: on_change_(std::move(on_change)) {} : on_change_(std::move(on_change)) {}

@@ -217,14 +217,14 @@ class ScopedNetworkPolicyApplicationObserver
}; };
class ScopedNetworkCertLoaderRefreshWaiter class ScopedNetworkCertLoaderRefreshWaiter
: public chromeos::NetworkCertLoader::Observer { : public ash::NetworkCertLoader::Observer {
public: public:
ScopedNetworkCertLoaderRefreshWaiter() { ScopedNetworkCertLoaderRefreshWaiter() {
chromeos::NetworkCertLoader::Get()->AddObserver(this); ash::NetworkCertLoader::Get()->AddObserver(this);
} }
~ScopedNetworkCertLoaderRefreshWaiter() override { ~ScopedNetworkCertLoaderRefreshWaiter() override {
chromeos::NetworkCertLoader::Get()->RemoveObserver(this); ash::NetworkCertLoader::Get()->RemoveObserver(this);
} }
void OnCertificatesLoaded() override { run_loop_.Quit(); } void OnCertificatesLoaded() override { run_loop_.Quit(); }
@@ -339,8 +339,7 @@ class NetworkPolicyApplicationTest : public ash::LoginManagerTest {
const std::string& key_filename) { const std::string& key_filename) {
// Before importing, configure NetworkCertLoader to assume that all // Before importing, configure NetworkCertLoader to assume that all
// certificates can be used for network authentication. // certificates can be used for network authentication.
chromeos::NetworkCertLoader::Get() ash::NetworkCertLoader::Get()->ForceAvailableForNetworkAuthForTesting();
->ForceAvailableForNetworkAuthForTesting();
net::ScopedCERTCertificate cert; net::ScopedCERTCertificate cert;
// Import testing key pair and certificate. // Import testing key pair and certificate.

@@ -119,7 +119,7 @@ const char kSigninScreenExtension2UpdateManifestPath[] =
// Allows waiting until the list of policy-pushed web-trusted certificates // Allows waiting until the list of policy-pushed web-trusted certificates
// changes. // changes.
class WebTrustedCertsChangedObserver class WebTrustedCertsChangedObserver
: public chromeos::PolicyCertificateProvider::Observer { : public ash::PolicyCertificateProvider::Observer {
public: public:
WebTrustedCertsChangedObserver() = default; WebTrustedCertsChangedObserver() = default;
@@ -128,7 +128,7 @@ class WebTrustedCertsChangedObserver
WebTrustedCertsChangedObserver& operator=( WebTrustedCertsChangedObserver& operator=(
const WebTrustedCertsChangedObserver&) = delete; const WebTrustedCertsChangedObserver&) = delete;
// chromeos::PolicyCertificateProvider::Observer // ash::PolicyCertificateProvider::Observer
void OnPolicyProvidedCertsChanged() override { run_loop_.Quit(); } void OnPolicyProvidedCertsChanged() override { run_loop_.Quit(); }
void Wait() { run_loop_.Run(); } void Wait() { run_loop_.Run(); }

@@ -10,8 +10,6 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/ash/smb_client/discovery/netbios_client_interface.h" #include "chrome/browser/ash/smb_client/discovery/netbios_client_interface.h"
// TODO(https://crbug.com/1164001): remove and use forward declaration.
#include "chromeos/ash/components/network/firewall_hole.h"
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "net/traffic_annotation/network_traffic_annotation.h" #include "net/traffic_annotation/network_traffic_annotation.h"
@@ -28,6 +26,9 @@ class NetworkContext;
} // namespace network } // namespace network
namespace ash { namespace ash {
class FirewallHole;
namespace smb_client { namespace smb_client {
// NetBiosClient handles a NetBios Name Query Request. // NetBiosClient handles a NetBios Name Query Request.

@@ -108,7 +108,7 @@ TetherService::TetherService(
notification_presenter_( notification_presenter_(
std::make_unique<chromeos::tether::TetherNotificationPresenter>( std::make_unique<chromeos::tether::TetherNotificationPresenter>(
profile_, profile_,
chromeos::NetworkConnect::Get())), NetworkConnect::Get())),
gms_core_notifications_state_tracker_( gms_core_notifications_state_tracker_(
std::make_unique<GmsCoreNotificationsStateTrackerImpl>()), std::make_unique<GmsCoreNotificationsStateTrackerImpl>()),
tether_host_fetcher_( tether_host_fetcher_(
@@ -156,7 +156,7 @@ void TetherService::StartTetherIfPossible() {
gms_core_notifications_state_tracker_.get(), profile_->GetPrefs(), gms_core_notifications_state_tracker_.get(), profile_->GetPrefs(),
network_state_handler_, network_state_handler_,
chromeos::NetworkHandler::Get()->managed_network_configuration_handler(), chromeos::NetworkHandler::Get()->managed_network_configuration_handler(),
chromeos::NetworkConnect::Get(), NetworkConnect::Get(),
chromeos::NetworkHandler::Get()->network_connection_handler(), adapter_, chromeos::NetworkHandler::Get()->network_connection_handler(), adapter_,
session_manager_); session_manager_);
} }

@@ -155,7 +155,7 @@ class TestTetherComponentFactory final : public TetherComponentImpl::Factory {
PrefService* pref_service, PrefService* pref_service,
chromeos::NetworkStateHandler* network_state_handler, chromeos::NetworkStateHandler* network_state_handler,
ManagedNetworkConfigurationHandler* managed_network_configuration_handler, ManagedNetworkConfigurationHandler* managed_network_configuration_handler,
chromeos::NetworkConnect* network_connect, NetworkConnect* network_connect,
NetworkConnectionHandler* network_connection_handler, NetworkConnectionHandler* network_connection_handler,
scoped_refptr<device::BluetoothAdapter> adapter, scoped_refptr<device::BluetoothAdapter> adapter,
session_manager::SessionManager* session_manager) override { session_manager::SessionManager* session_manager) override {
@@ -297,7 +297,7 @@ class TetherServiceTest : public testing::Test {
fake_notification_presenter_ = nullptr; fake_notification_presenter_ = nullptr;
mock_timer_ = nullptr; mock_timer_ = nullptr;
chromeos::NetworkConnect::Initialize(nullptr); NetworkConnect::Initialize(nullptr);
TestingProfile::Builder builder; TestingProfile::Builder builder;
profile_ = builder.Build(); profile_ = builder.Build();
@@ -391,7 +391,7 @@ class TetherServiceTest : public testing::Test {
shutdown_reason_verified_); shutdown_reason_verified_);
chromeos::PowerManagerClient::Shutdown(); chromeos::PowerManagerClient::Shutdown();
chromeos::NetworkConnect::Shutdown(); NetworkConnect::Shutdown();
} }
void SetPrimaryUserLoggedIn() { void SetPrimaryUserLoggedIn() {

@@ -304,7 +304,7 @@ class CertsSourcePlatformNSS : public CertificateManagerModel::CertsSource,
#if BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS)
// Provides certificates installed through enterprise policy. // Provides certificates installed through enterprise policy.
class CertsSourcePolicy : public CertificateManagerModel::CertsSource, class CertsSourcePolicy : public CertificateManagerModel::CertsSource,
chromeos::PolicyCertificateProvider::Observer { ash::PolicyCertificateProvider::Observer {
public: public:
// Defines which policy-provided certificates this CertsSourcePolicy instance // Defines which policy-provided certificates this CertsSourcePolicy instance
// should yield. // should yield.
@@ -318,7 +318,7 @@ class CertsSourcePolicy : public CertificateManagerModel::CertsSource,
}; };
CertsSourcePolicy(base::RepeatingClosure certs_source_updated_callback, CertsSourcePolicy(base::RepeatingClosure certs_source_updated_callback,
chromeos::PolicyCertificateProvider* policy_certs_provider, ash::PolicyCertificateProvider* policy_certs_provider,
Mode mode) Mode mode)
: CertsSource(certs_source_updated_callback), : CertsSource(certs_source_updated_callback),
policy_certs_provider_(policy_certs_provider), policy_certs_provider_(policy_certs_provider),
@@ -333,7 +333,7 @@ class CertsSourcePolicy : public CertificateManagerModel::CertsSource,
policy_certs_provider_->RemovePolicyProvidedCertsObserver(this); policy_certs_provider_->RemovePolicyProvidedCertsObserver(this);
} }
// chromeos::PolicyCertificateProvider::Observer // ash::PolicyCertificateProvider::Observer
void OnPolicyProvidedCertsChanged() override { void OnPolicyProvidedCertsChanged() override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
Refresh(); Refresh();
@@ -400,7 +400,7 @@ class CertsSourcePolicy : public CertificateManagerModel::CertsSource,
SetCertInfos(std::move(cert_infos)); SetCertInfos(std::move(cert_infos));
} }
raw_ptr<chromeos::PolicyCertificateProvider> policy_certs_provider_; raw_ptr<ash::PolicyCertificateProvider> policy_certs_provider_;
Mode mode_; Mode mode_;
}; };

@@ -24,10 +24,13 @@ class BrowserContext;
} // namespace content } // namespace content
#if BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS)
namespace ash {
class PolicyCertificateProvider;
}
namespace chromeos { namespace chromeos {
class CertificateProvider; class CertificateProvider;
class PolicyCertificateProvider; }
} // namespace chromeos
#endif #endif
// CertificateManagerModel provides the data to be displayed in the certificate // CertificateManagerModel provides the data to be displayed in the certificate
@@ -126,8 +129,7 @@ class CertificateManagerModel {
struct Params { struct Params {
#if BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS)
// May be nullptr. // May be nullptr.
raw_ptr<chromeos::PolicyCertificateProvider> policy_certs_provider = raw_ptr<ash::PolicyCertificateProvider> policy_certs_provider = nullptr;
nullptr;
// May be nullptr. // May be nullptr.
std::unique_ptr<chromeos::CertificateProvider> std::unique_ptr<chromeos::CertificateProvider>
extension_certificate_provider; extension_certificate_provider;

@@ -207,8 +207,7 @@ TEST_F(CertificateManagerModelTest, ListsClientCertsFromPlatform) {
#if BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS)
namespace { namespace {
class FakePolicyCertificateProvider class FakePolicyCertificateProvider : public ash::PolicyCertificateProvider {
: public chromeos::PolicyCertificateProvider {
public: public:
void AddPolicyProvidedCertsObserver(Observer* observer) override { void AddPolicyProvidedCertsObserver(Observer* observer) override {
observer_list_.AddObserver(observer); observer_list_.AddObserver(observer);

@@ -17,7 +17,7 @@ NetworkingPrivateUIDelegateChromeOS::~NetworkingPrivateUIDelegateChromeOS() {}
void NetworkingPrivateUIDelegateChromeOS::ShowAccountDetails( void NetworkingPrivateUIDelegateChromeOS::ShowAccountDetails(
const std::string& guid) const { const std::string& guid) const {
chromeos::NetworkConnect::Get()->ShowCarrierAccountDetail(guid); ash::NetworkConnect::Get()->ShowCarrierAccountDetail(guid);
} }
} // namespace extensions } // namespace extensions

@@ -7,7 +7,7 @@
#include "chromeos/ash/components/network/firewall_hole.h" #include "chromeos/ash/components/network/firewall_hole.h"
NearbyConnectionsFirewallHole::NearbyConnectionsFirewallHole( NearbyConnectionsFirewallHole::NearbyConnectionsFirewallHole(
std::unique_ptr<chromeos::FirewallHole> firewall_hole) std::unique_ptr<ash::FirewallHole> firewall_hole)
: firewall_hole_(std::move(firewall_hole)) {} : firewall_hole_(std::move(firewall_hole)) {}
NearbyConnectionsFirewallHole::~NearbyConnectionsFirewallHole() = default; NearbyConnectionsFirewallHole::~NearbyConnectionsFirewallHole() = default;

@@ -9,24 +9,24 @@
#include "ash/services/nearby/public/mojom/firewall_hole.mojom.h" #include "ash/services/nearby/public/mojom/firewall_hole.mojom.h"
namespace chromeos { namespace ash {
class FirewallHole; class FirewallHole;
} // namespace chromeos }
// An implementation of the mojo interface representing a firewall hole for // An implementation of the mojo interface representing a firewall hole for
// Nearby Connections WifiLan TCP sockets. This implementation is essentially a // Nearby Connections WifiLan TCP sockets. This implementation is essentially a
// wrapper around a chromeos::FirewallHole. // wrapper around a ash::FirewallHole.
class NearbyConnectionsFirewallHole : public sharing::mojom::FirewallHole { class NearbyConnectionsFirewallHole : public sharing::mojom::FirewallHole {
public: public:
explicit NearbyConnectionsFirewallHole( explicit NearbyConnectionsFirewallHole(
std::unique_ptr<chromeos::FirewallHole> firewall_hole); std::unique_ptr<ash::FirewallHole> firewall_hole);
NearbyConnectionsFirewallHole(const NearbyConnectionsFirewallHole&) = delete; NearbyConnectionsFirewallHole(const NearbyConnectionsFirewallHole&) = delete;
NearbyConnectionsFirewallHole& operator=( NearbyConnectionsFirewallHole& operator=(
const NearbyConnectionsFirewallHole&) = delete; const NearbyConnectionsFirewallHole&) = delete;
~NearbyConnectionsFirewallHole() override; ~NearbyConnectionsFirewallHole() override;
private: private:
std::unique_ptr<chromeos::FirewallHole> firewall_hole_; std::unique_ptr<ash::FirewallHole> firewall_hole_;
}; };
#endif // CHROME_BROWSER_NEARBY_SHARING_FIREWALL_HOLE_NEARBY_CONNECTIONS_FIREWALL_HOLE_H_ #endif // CHROME_BROWSER_NEARBY_SHARING_FIREWALL_HOLE_NEARBY_CONNECTIONS_FIREWALL_HOLE_H_

@@ -23,8 +23,8 @@ NearbyConnectionsFirewallHoleFactory::~NearbyConnectionsFirewallHoleFactory() =
void NearbyConnectionsFirewallHoleFactory::OpenFirewallHole( void NearbyConnectionsFirewallHoleFactory::OpenFirewallHole(
const ash::nearby::TcpServerSocketPort& port, const ash::nearby::TcpServerSocketPort& port,
OpenFirewallHoleCallback callback) { OpenFirewallHoleCallback callback) {
chromeos::FirewallHole::Open( ash::FirewallHole::Open(
chromeos::FirewallHole::PortType::TCP, port.port(), ash::FirewallHole::PortType::TCP, port.port(),
/*interface=*/std::string(), /*interface=*/std::string(),
base::BindOnce( base::BindOnce(
&NearbyConnectionsFirewallHoleFactory::OnFirewallHoleOpened, &NearbyConnectionsFirewallHoleFactory::OnFirewallHoleOpened,
@@ -34,7 +34,7 @@ void NearbyConnectionsFirewallHoleFactory::OpenFirewallHole(
void NearbyConnectionsFirewallHoleFactory::OnFirewallHoleOpened( void NearbyConnectionsFirewallHoleFactory::OnFirewallHoleOpened(
const ash::nearby::TcpServerSocketPort& port, const ash::nearby::TcpServerSocketPort& port,
OpenFirewallHoleCallback callback, OpenFirewallHoleCallback callback,
std::unique_ptr<chromeos::FirewallHole> firewall_hole) { std::unique_ptr<ash::FirewallHole> firewall_hole) {
if (!firewall_hole) { if (!firewall_hole) {
LOG(ERROR) << "NearbyConnectionsFirewallHoleFactory::" << __func__ LOG(ERROR) << "NearbyConnectionsFirewallHoleFactory::" << __func__
<< ": Failed to open TCP firewall hole on port " << port.port(); << ": Failed to open TCP firewall hole on port " << port.port();

@@ -12,18 +12,15 @@
#include "mojo/public/cpp/bindings/unique_receiver_set.h" #include "mojo/public/cpp/bindings/unique_receiver_set.h"
namespace ash { namespace ash {
class FirewallHole;
namespace nearby { namespace nearby {
class TcpServerSocketPort; class TcpServerSocketPort;
} // namespace nearby } // namespace nearby
} // namespace ash } // namespace ash
namespace chromeos {
class FirewallHole;
} // namespace chromeos
// An implementation of the mojo service used to open firewall holes for Nearby // An implementation of the mojo service used to open firewall holes for Nearby
// Connections WifiLan TCP sockets. This implementation is essentially a wrapper // Connections WifiLan TCP sockets. This implementation is essentially a wrapper
// around chromeos::FirewallHole::Open(). The lifetime of a firewall hole // around ash::FirewallHole::Open(). The lifetime of a firewall hole
// mirrors the lifetime of the mojo remote provided by OpenFirewallHole(); the // mirrors the lifetime of the mojo remote provided by OpenFirewallHole(); the
// corresponding mojo receivers are owned by |firewall_hole_receivers_|. // corresponding mojo receivers are owned by |firewall_hole_receivers_|.
class NearbyConnectionsFirewallHoleFactory class NearbyConnectionsFirewallHoleFactory
@@ -40,10 +37,9 @@ class NearbyConnectionsFirewallHoleFactory
OpenFirewallHoleCallback callback) override; OpenFirewallHoleCallback callback) override;
private: private:
void OnFirewallHoleOpened( void OnFirewallHoleOpened(const ash::nearby::TcpServerSocketPort& port,
const ash::nearby::TcpServerSocketPort& port, OpenFirewallHoleCallback callback,
OpenFirewallHoleCallback callback, std::unique_ptr<ash::FirewallHole> firewall_hole);
std::unique_ptr<chromeos::FirewallHole> firewall_hole);
mojo::UniqueReceiverSet<sharing::mojom::FirewallHole> mojo::UniqueReceiverSet<sharing::mojom::FirewallHole>
firewall_hole_receivers_; firewall_hole_receivers_;

@@ -46,7 +46,7 @@ ProxyServiceFactory::CreateProxyConfigService(PrefProxyConfigTracker* tracker,
std::make_unique<chromeos::ProxyConfigServiceLacros>(profile); std::make_unique<chromeos::ProxyConfigServiceLacros>(profile);
} }
#elif !BUILDFLAG(IS_CHROMEOS_ASH) #elif !BUILDFLAG(IS_CHROMEOS_ASH)
// On Ash-Chrome, base service is NULL; chromeos::ProxyConfigServiceImpl // On Ash-Chrome, base service is NULL; ash::ProxyConfigServiceImpl
// determines the effective proxy config to take effect in the network layer, // determines the effective proxy config to take effect in the network layer,
// be it from prefs or system (which is network shill on chromeos). // be it from prefs or system (which is network shill on chromeos).
@@ -67,7 +67,7 @@ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
PrefService* profile_prefs, PrefService* profile_prefs,
PrefService* local_state_prefs) { PrefService* local_state_prefs) {
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
return std::make_unique<chromeos::ProxyConfigServiceImpl>( return std::make_unique<ash::ProxyConfigServiceImpl>(
profile_prefs, local_state_prefs, nullptr); profile_prefs, local_state_prefs, nullptr);
#else #else
return std::make_unique<PrefProxyConfigTrackerImpl>(profile_prefs, nullptr); return std::make_unique<PrefProxyConfigTrackerImpl>(profile_prefs, nullptr);
@@ -79,7 +79,7 @@ std::unique_ptr<PrefProxyConfigTracker>
ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
PrefService* local_state_prefs) { PrefService* local_state_prefs) {
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
return std::make_unique<chromeos::ProxyConfigServiceImpl>( return std::make_unique<ash::ProxyConfigServiceImpl>(
nullptr, local_state_prefs, nullptr); nullptr, local_state_prefs, nullptr);
#else #else
return std::make_unique<PrefProxyConfigTrackerImpl>(local_state_prefs, return std::make_unique<PrefProxyConfigTrackerImpl>(local_state_prefs,

@@ -81,12 +81,12 @@ void NetworkConfigurationUpdater::OnPolicyServiceInitialized(
} }
void NetworkConfigurationUpdater::AddPolicyProvidedCertsObserver( void NetworkConfigurationUpdater::AddPolicyProvidedCertsObserver(
chromeos::PolicyCertificateProvider::Observer* observer) { ash::PolicyCertificateProvider::Observer* observer) {
observer_list_.AddObserver(observer); observer_list_.AddObserver(observer);
} }
void NetworkConfigurationUpdater::RemovePolicyProvidedCertsObserver( void NetworkConfigurationUpdater::RemovePolicyProvidedCertsObserver(
chromeos::PolicyCertificateProvider::Observer* observer) { ash::PolicyCertificateProvider::Observer* observer) {
observer_list_.RemoveObserver(observer); observer_list_.RemoveObserver(observer);
} }

@@ -34,7 +34,7 @@ class PolicyMap;
// (that will be propagated to the network service). Provides entry points for // (that will be propagated to the network service). Provides entry points for
// handling client certificates and network configurations in subclasses. // handling client certificates and network configurations in subclasses.
// Does not handle proxy settings. // Does not handle proxy settings.
class NetworkConfigurationUpdater : public chromeos::PolicyCertificateProvider, class NetworkConfigurationUpdater : public ash::PolicyCertificateProvider,
public PolicyService::Observer { public PolicyService::Observer {
public: public:
NetworkConfigurationUpdater(const NetworkConfigurationUpdater&) = delete; NetworkConfigurationUpdater(const NetworkConfigurationUpdater&) = delete;
@@ -51,11 +51,11 @@ class NetworkConfigurationUpdater : public chromeos::PolicyCertificateProvider,
// The observer interface sends notifications about changes in server and // The observer interface sends notifications about changes in server and
// authority certificates. // authority certificates.
// chromeos::PolicyCertificateProvider: // ash::PolicyCertificateProvider:
void AddPolicyProvidedCertsObserver( void AddPolicyProvidedCertsObserver(
chromeos::PolicyCertificateProvider::Observer* observer) override; ash::PolicyCertificateProvider::Observer* observer) override;
void RemovePolicyProvidedCertsObserver( void RemovePolicyProvidedCertsObserver(
chromeos::PolicyCertificateProvider::Observer* observer) override; ash::PolicyCertificateProvider::Observer* observer) override;
net::CertificateList GetAllServerAndAuthorityCertificates( net::CertificateList GetAllServerAndAuthorityCertificates(
const chromeos::onc::CertificateScope& scope) const override; const chromeos::onc::CertificateScope& scope) const override;
net::CertificateList GetAllAuthorityCertificates( net::CertificateList GetAllAuthorityCertificates(
@@ -149,8 +149,8 @@ class NetworkConfigurationUpdater : public chromeos::PolicyCertificateProvider,
// Observer list for notifying about ONC-provided server and CA certificate // Observer list for notifying about ONC-provided server and CA certificate
// changes. // changes.
base::ObserverList<chromeos::PolicyCertificateProvider::Observer, base::ObserverList<ash::PolicyCertificateProvider::Observer, true>::Unchecked
true>::Unchecked observer_list_; observer_list_;
}; };
} // namespace policy } // namespace policy

@@ -88,7 +88,7 @@ class FakeUser : public user_manager::User {
}; };
class MockPolicyProvidedCertsObserver class MockPolicyProvidedCertsObserver
: public chromeos::PolicyCertificateProvider::Observer { : public ash::PolicyCertificateProvider::Observer {
public: public:
MockPolicyProvidedCertsObserver() = default; MockPolicyProvidedCertsObserver() = default;

@@ -37,7 +37,7 @@ namespace policy {
namespace { namespace {
class MockPolicyProvidedCertsObserver class MockPolicyProvidedCertsObserver
: public chromeos::PolicyCertificateProvider::Observer { : public ash::PolicyCertificateProvider::Observer {
public: public:
MockPolicyProvidedCertsObserver() = default; MockPolicyProvidedCertsObserver() = default;

@@ -36,7 +36,7 @@ PolicyCertService::~PolicyCertService() {
PolicyCertService::PolicyCertService( PolicyCertService::PolicyCertService(
Profile* profile, Profile* profile,
chromeos::PolicyCertificateProvider* policy_certificate_provider, ash::PolicyCertificateProvider* policy_certificate_provider,
bool may_use_profile_wide_trust_anchors) bool may_use_profile_wide_trust_anchors)
: profile_(profile), : profile_(profile),
policy_certificate_provider_(policy_certificate_provider), policy_certificate_provider_(policy_certificate_provider),

@@ -38,17 +38,16 @@ namespace policy {
// This service / its factory keep track of which Profile has used a // This service / its factory keep track of which Profile has used a
// policy-provided trust anchor. // policy-provided trust anchor.
class PolicyCertService : public KeyedService, class PolicyCertService : public KeyedService,
public chromeos::PolicyCertificateProvider::Observer { public ash::PolicyCertificateProvider::Observer {
public: public:
// Constructs a PolicyCertService for |profile| using // Constructs a PolicyCertService for |profile| using
// |policy_certificate_provider| as the source of certificates. // |policy_certificate_provider| as the source of certificates.
// If |may_use_profile_wide_trust_anchors| is true, certificates from // If |may_use_profile_wide_trust_anchors| is true, certificates from
// |policy_certificate_provider| that have requested "Web" trust and have // |policy_certificate_provider| that have requested "Web" trust and have
// profile-wide scope will be used for |profile|. // profile-wide scope will be used for |profile|.
PolicyCertService( PolicyCertService(Profile* profile,
Profile* profile, ash::PolicyCertificateProvider* policy_certificate_provider,
chromeos::PolicyCertificateProvider* policy_certificate_provider, bool may_use_profile_wide_trust_anchors);
bool may_use_profile_wide_trust_anchors);
PolicyCertService(const PolicyCertService&) = delete; PolicyCertService(const PolicyCertService&) = delete;
PolicyCertService& operator=(const PolicyCertService&) = delete; PolicyCertService& operator=(const PolicyCertService&) = delete;
@@ -104,8 +103,7 @@ class PolicyCertService : public KeyedService,
const raw_ptr<Profile> profile_; const raw_ptr<Profile> profile_;
// The source of certificates for this PolicyCertService. // The source of certificates for this PolicyCertService.
const raw_ptr<chromeos::PolicyCertificateProvider> const raw_ptr<ash::PolicyCertificateProvider> policy_certificate_provider_;
policy_certificate_provider_;
// If true, CA certificates |policy_certificate_provider_| that have requested // If true, CA certificates |policy_certificate_provider_| that have requested
// "Web" trust and have profile-wide scope may be used for |profile_|. // "Web" trust and have profile-wide scope may be used for |profile_|.

@@ -33,8 +33,7 @@ namespace {
// Returns the PolicyCertificateProvider that should be used for |profile|. // Returns the PolicyCertificateProvider that should be used for |profile|.
// May return nullptr, which should be treated as no policy-provided // May return nullptr, which should be treated as no policy-provided
// certificates set. // certificates set.
chromeos::PolicyCertificateProvider* GetPolicyCertificateProvider( ash::PolicyCertificateProvider* GetPolicyCertificateProvider(Profile* profile) {
Profile* profile) {
if (ash::ProfileHelper::Get()->IsSigninProfile(profile)) { if (ash::ProfileHelper::Get()->IsSigninProfile(profile)) {
return g_browser_process->platform_part() return g_browser_process->platform_part()
->browser_policy_connector_ash() ->browser_policy_connector_ash()
@@ -47,7 +46,7 @@ chromeos::PolicyCertificateProvider* GetPolicyCertificateProvider(
KeyedService* BuildServiceInstanceAsh(content::BrowserContext* context) { KeyedService* BuildServiceInstanceAsh(content::BrowserContext* context) {
Profile* profile = Profile::FromBrowserContext(context); Profile* profile = Profile::FromBrowserContext(context);
chromeos::PolicyCertificateProvider* policy_certificate_provider = ash::PolicyCertificateProvider* policy_certificate_provider =
GetPolicyCertificateProvider(profile); GetPolicyCertificateProvider(profile);
if (!policy_certificate_provider) if (!policy_certificate_provider)
return nullptr; return nullptr;
@@ -87,7 +86,7 @@ KeyedService* BuildServiceInstanceAsh(content::BrowserContext* context) {
KeyedService* BuildServiceInstanceLacros(content::BrowserContext* context) { KeyedService* BuildServiceInstanceLacros(content::BrowserContext* context) {
Profile* profile = Profile::FromBrowserContext(context); Profile* profile = Profile::FromBrowserContext(context);
chromeos::PolicyCertificateProvider* policy_certificate_provider = ash::PolicyCertificateProvider* policy_certificate_provider =
UserNetworkConfigurationUpdaterFactory::GetForBrowserContext(profile); UserNetworkConfigurationUpdaterFactory::GetForBrowserContext(profile);
if (!policy_certificate_provider) if (!policy_certificate_provider)
return nullptr; return nullptr;

@@ -49,9 +49,8 @@ void GetNssCertDatabaseOnIOThread(
UserNetworkConfigurationUpdaterAsh::~UserNetworkConfigurationUpdaterAsh() { UserNetworkConfigurationUpdaterAsh::~UserNetworkConfigurationUpdaterAsh() {
// NetworkCertLoader may be not initialized in tests. // NetworkCertLoader may be not initialized in tests.
if (chromeos::NetworkCertLoader::IsInitialized()) { if (ash::NetworkCertLoader::IsInitialized()) {
chromeos::NetworkCertLoader::Get()->SetUserPolicyCertificateProvider( ash::NetworkCertLoader::Get()->SetUserPolicyCertificateProvider(nullptr);
nullptr);
} }
} }
@@ -126,8 +125,8 @@ UserNetworkConfigurationUpdaterAsh::UserNetworkConfigurationUpdaterAsh(
// primary profile. This assumes that a |UserNetworkConfigurationUpdaterAsh| // primary profile. This assumes that a |UserNetworkConfigurationUpdaterAsh|
// is only created for the primary profile. NetworkCertLoader may be not // is only created for the primary profile. NetworkCertLoader may be not
// initialized in tests. // initialized in tests.
if (chromeos::NetworkCertLoader::IsInitialized()) if (ash::NetworkCertLoader::IsInitialized())
chromeos::NetworkCertLoader::Get()->SetUserPolicyCertificateProvider(this); ash::NetworkCertLoader::Get()->SetUserPolicyCertificateProvider(this);
// Set profile-wide expansions for policy networks (i.e. those that apply to // Set profile-wide expansions for policy networks (i.e. those that apply to
// all networks in this profile). Note that this does currently not apply // all networks in this profile). Note that this does currently not apply

@@ -79,7 +79,7 @@ constexpr char kRootCaCert[] = "root_ca_cert.pem";
// Allows waiting until the list of policy-pushed web-trusted certificates // Allows waiting until the list of policy-pushed web-trusted certificates
// changes. // changes.
class WebTrustedCertsChangedObserver class WebTrustedCertsChangedObserver
: public chromeos::PolicyCertificateProvider::Observer { : public ash::PolicyCertificateProvider::Observer {
public: public:
WebTrustedCertsChangedObserver() = default; WebTrustedCertsChangedObserver() = default;
@@ -88,7 +88,7 @@ class WebTrustedCertsChangedObserver
WebTrustedCertsChangedObserver& operator=( WebTrustedCertsChangedObserver& operator=(
const WebTrustedCertsChangedObserver&) = delete; const WebTrustedCertsChangedObserver&) = delete;
// chromeos::PolicyCertificateProvider::Observer // ash::PolicyCertificateProvider::Observer
void OnPolicyProvidedCertsChanged() override { run_loop_.Quit(); } void OnPolicyProvidedCertsChanged() override { run_loop_.Quit(); }
void Wait() { run_loop_.Run(); } void Wait() { run_loop_.Run(); }
@@ -98,11 +98,10 @@ class WebTrustedCertsChangedObserver
}; };
// Allows waiting until |NetworkCertLoader| updates its list of certificates. // Allows waiting until |NetworkCertLoader| updates its list of certificates.
class NetworkCertLoaderTestObserver class NetworkCertLoaderTestObserver : public ash::NetworkCertLoader::Observer {
: public chromeos::NetworkCertLoader::Observer {
public: public:
explicit NetworkCertLoaderTestObserver( explicit NetworkCertLoaderTestObserver(
chromeos::NetworkCertLoader* network_cert_loader) ash::NetworkCertLoader* network_cert_loader)
: network_cert_loader_(network_cert_loader) { : network_cert_loader_(network_cert_loader) {
network_cert_loader_->AddObserver(this); network_cert_loader_->AddObserver(this);
} }
@@ -115,13 +114,13 @@ class NetworkCertLoaderTestObserver
network_cert_loader_->RemoveObserver(this); network_cert_loader_->RemoveObserver(this);
} }
// chromeos::NetworkCertLoader::Observer // ash::NetworkCertLoader::Observer
void OnCertificatesLoaded() override { run_loop_.Quit(); } void OnCertificatesLoaded() override { run_loop_.Quit(); }
void Wait() { run_loop_.Run(); } void Wait() { run_loop_.Run(); }
private: private:
raw_ptr<chromeos::NetworkCertLoader> network_cert_loader_; raw_ptr<ash::NetworkCertLoader> network_cert_loader_;
base::RunLoop run_loop_; base::RunLoop run_loop_;
}; };
@@ -540,7 +539,7 @@ IN_PROC_BROWSER_TEST_F(PolicyProvidedCertsRegularUserTest,
bool IsCertInCertificateList( bool IsCertInCertificateList(
const net::X509Certificate* cert, const net::X509Certificate* cert,
const chromeos::NetworkCertLoader::NetworkCertList& network_cert_list) { const ash::NetworkCertLoader::NetworkCertList& network_cert_list) {
for (const auto& network_cert : network_cert_list) { for (const auto& network_cert : network_cert_list) {
if (net::x509_util::IsSameCertificate(network_cert.cert(), cert)) if (net::x509_util::IsSameCertificate(network_cert.cert(), cert))
return true; return true;
@@ -554,14 +553,14 @@ IN_PROC_BROWSER_TEST_F(PolicyProvidedCertsRegularUserTest,
// properly initialized because |UserSessionManager| only sets the primary // properly initialized because |UserSessionManager| only sets the primary
// user's NSS Database in |NetworkCertLoader| if running on ChromeOS according // user's NSS Database in |NetworkCertLoader| if running on ChromeOS according
// to |base::SysInfo|. // to |base::SysInfo|.
ASSERT_TRUE(chromeos::NetworkCertLoader::IsInitialized()); ASSERT_TRUE(ash::NetworkCertLoader::IsInitialized());
chromeos::NetworkCertLoader::Get()->SetUserNSSDB(test_nss_cert_db_.get()); ash::NetworkCertLoader::Get()->SetUserNSSDB(test_nss_cert_db_.get());
EXPECT_FALSE(IsCertInCertificateList( EXPECT_FALSE(IsCertInCertificateList(
user_policy_certs_helper_.root_cert().get(), user_policy_certs_helper_.root_cert().get(),
chromeos::NetworkCertLoader::Get()->authority_certs())); ash::NetworkCertLoader::Get()->authority_certs()));
NetworkCertLoaderTestObserver network_cert_loader_observer( NetworkCertLoaderTestObserver network_cert_loader_observer(
chromeos::NetworkCertLoader::Get()); ash::NetworkCertLoader::Get());
user_policy_certs_helper_.SetRootCertONCUserPolicy( user_policy_certs_helper_.SetRootCertONCUserPolicy(
multi_profile_policy_helper_.profile_1(), multi_profile_policy_helper_.profile_1(),
multi_profile_policy_helper_.policy_for_profile_1()); multi_profile_policy_helper_.policy_for_profile_1());
@@ -572,7 +571,7 @@ IN_PROC_BROWSER_TEST_F(PolicyProvidedCertsRegularUserTest,
// set a policy with a certificate requesting Web Trust here). // set a policy with a certificate requesting Web Trust here).
EXPECT_TRUE(IsCertInCertificateList( EXPECT_TRUE(IsCertInCertificateList(
user_policy_certs_helper_.root_cert().get(), user_policy_certs_helper_.root_cert().get(),
chromeos::NetworkCertLoader::Get()->authority_certs())); ash::NetworkCertLoader::Get()->authority_certs()));
} }
#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)

@@ -141,7 +141,7 @@ void ChromeBrowserMainExtraPartsAsh::PreProfileInit() {
// NetworkConnect handles the network connection state machine for the UI. // NetworkConnect handles the network connection state machine for the UI.
network_connect_delegate_ = network_connect_delegate_ =
std::make_unique<NetworkConnectDelegateChromeOS>(); std::make_unique<NetworkConnectDelegateChromeOS>();
chromeos::NetworkConnect::Initialize(network_connect_delegate_.get()); ash::NetworkConnect::Initialize(network_connect_delegate_.get());
cast_config_controller_media_router_ = cast_config_controller_media_router_ =
std::make_unique<CastConfigControllerMediaRouter>(); std::make_unique<CastConfigControllerMediaRouter>();
@@ -367,8 +367,8 @@ void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() {
ambient_client_.reset(); ambient_client_.reset();
cast_config_controller_media_router_.reset(); cast_config_controller_media_router_.reset();
if (chromeos::NetworkConnect::IsInitialized()) if (ash::NetworkConnect::IsInitialized())
chromeos::NetworkConnect::Shutdown(); ash::NetworkConnect::Shutdown();
network_connect_delegate_.reset(); network_connect_delegate_.reset();
user_profile_loaded_observer_.reset(); user_profile_loaded_observer_.reset();
} }

@@ -41,7 +41,7 @@ const char kCellularGuid[] = "cellular1_guid";
const char kNotificationId[] = "chrome://settings/internet/mobile_data"; const char kNotificationId[] = "chrome://settings/internet/mobile_data";
const char kTestUserName[] = "test-user@example.com"; const char kTestUserName[] = "test-user@example.com";
class NetworkConnectTestDelegate : public chromeos::NetworkConnect::Delegate { class NetworkConnectTestDelegate : public ash::NetworkConnect::Delegate {
public: public:
NetworkConnectTestDelegate() {} NetworkConnectTestDelegate() {}
@@ -82,13 +82,13 @@ class MobileDataNotificationsTest : public testing::Test {
SetupNetworkShillState(); SetupNetworkShillState();
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
network_connect_delegate_ = std::make_unique<NetworkConnectTestDelegate>(); network_connect_delegate_ = std::make_unique<NetworkConnectTestDelegate>();
chromeos::NetworkConnect::Initialize(network_connect_delegate_.get()); ash::NetworkConnect::Initialize(network_connect_delegate_.get());
mobile_data_notifications_ = std::make_unique<MobileDataNotifications>(); mobile_data_notifications_ = std::make_unique<MobileDataNotifications>();
} }
void TearDown() override { void TearDown() override {
mobile_data_notifications_.reset(); mobile_data_notifications_.reset();
chromeos::NetworkConnect::Shutdown(); ash::NetworkConnect::Shutdown();
network_connect_delegate_.reset(); network_connect_delegate_.reset();
profile_manager_.reset(); profile_manager_.reset();
user_manager_enabler_.reset(); user_manager_enabler_.reset();
@@ -180,7 +180,7 @@ TEST_F(MobileDataNotificationsTest, SimpleSetup) {
TEST_F(MobileDataNotificationsTest, NotificationAlreadyShown) { TEST_F(MobileDataNotificationsTest, NotificationAlreadyShown) {
pref_service()->SetBoolean(prefs::kShowMobileDataNotification, false); pref_service()->SetBoolean(prefs::kShowMobileDataNotification, false);
chromeos::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid); ash::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid);
// Wait for async ConnectToNetworkId to take effect. // Wait for async ConnectToNetworkId to take effect.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
@@ -191,7 +191,7 @@ TEST_F(MobileDataNotificationsTest, NotificationAlreadyShown) {
TEST_F(MobileDataNotificationsTest, DisplayNotification) { TEST_F(MobileDataNotificationsTest, DisplayNotification) {
pref_service()->SetBoolean(prefs::kShowMobileDataNotification, true); pref_service()->SetBoolean(prefs::kShowMobileDataNotification, true);
chromeos::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid); ash::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid);
// Wait for async ConnectToNetworkId to take effect. // Wait for async ConnectToNetworkId to take effect.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
@@ -202,7 +202,7 @@ TEST_F(MobileDataNotificationsTest, DisplayNotification) {
TEST_F(MobileDataNotificationsTest, TogglesPref) { TEST_F(MobileDataNotificationsTest, TogglesPref) {
pref_service()->SetBoolean(prefs::kShowMobileDataNotification, true); pref_service()->SetBoolean(prefs::kShowMobileDataNotification, true);
chromeos::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid); ash::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid);
// Wait for async ConnectToNetworkId to take effect. // Wait for async ConnectToNetworkId to take effect.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
@@ -213,7 +213,7 @@ TEST_F(MobileDataNotificationsTest, TogglesPref) {
// connected. // connected.
TEST_F(MobileDataNotificationsTest, SessionUpdateDisplayNotification) { TEST_F(MobileDataNotificationsTest, SessionUpdateDisplayNotification) {
// Set up cellular network, don't trigger notification. // Set up cellular network, don't trigger notification.
chromeos::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid); ash::NetworkConnect::Get()->ConnectToNetworkId(kCellularGuid);
pref_service()->SetBoolean(prefs::kShowMobileDataNotification, false); pref_service()->SetBoolean(prefs::kShowMobileDataNotification, false);
// Process network observer update. // Process network observer update.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();

@@ -18,8 +18,7 @@ namespace chromeos {
class NetworkStateNotifier; class NetworkStateNotifier;
} }
class NetworkConnectDelegateChromeOS class NetworkConnectDelegateChromeOS : public ash::NetworkConnect::Delegate {
: public chromeos::NetworkConnect::Delegate {
public: public:
NetworkConnectDelegateChromeOS(); NetworkConnectDelegateChromeOS();

@@ -642,7 +642,7 @@ void NetworkStateNotifier::ShowSimUnlockSettings() {
void NetworkStateNotifier::ShowCarrierAccountDetail( void NetworkStateNotifier::ShowCarrierAccountDetail(
const std::string& network_id) { const std::string& network_id) {
NetworkConnect::Get()->ShowCarrierAccountDetail(network_id); ash::NetworkConnect::Get()->ShowCarrierAccountDetail(network_id);
} }
} // namespace chromeos } // namespace chromeos

@@ -120,7 +120,7 @@ constexpr const char* const
TetherNotificationPresenter::TetherNotificationPresenter( TetherNotificationPresenter::TetherNotificationPresenter(
Profile* profile, Profile* profile,
NetworkConnect* network_connect) ash::NetworkConnect* network_connect)
: profile_(profile), : profile_(profile),
network_connect_(network_connect), network_connect_(network_connect),
settings_ui_delegate_(base::WrapUnique(new SettingsUiDelegateImpl())) {} settings_ui_delegate_(base::WrapUnique(new SettingsUiDelegateImpl())) {}

@@ -18,15 +18,15 @@
class Profile; class Profile;
namespace ash {
class NetworkConnect;
}
namespace message_center { namespace message_center {
class Notification; class Notification;
} // namespace message_center } // namespace message_center
namespace chromeos { namespace chromeos::tether {
class NetworkConnect;
namespace tether {
// Produces notifications associated with CrOS tether network events and alerts // Produces notifications associated with CrOS tether network events and alerts
// observers about interactions with those notifications. // observers about interactions with those notifications.
@@ -35,7 +35,7 @@ class TetherNotificationPresenter : public NotificationPresenter {
// Caller must ensure that |profile| and |network_connect| outlive this // Caller must ensure that |profile| and |network_connect| outlive this
// instance. // instance.
TetherNotificationPresenter(Profile* profile, TetherNotificationPresenter(Profile* profile,
NetworkConnect* network_connect); ash::NetworkConnect* network_connect);
TetherNotificationPresenter(const TetherNotificationPresenter&) = delete; TetherNotificationPresenter(const TetherNotificationPresenter&) = delete;
TetherNotificationPresenter& operator=(const TetherNotificationPresenter&) = TetherNotificationPresenter& operator=(const TetherNotificationPresenter&) =
@@ -111,7 +111,7 @@ class TetherNotificationPresenter : public NotificationPresenter {
void RemoveNotificationIfVisible(const std::string& notification_id); void RemoveNotificationIfVisible(const std::string& notification_id);
Profile* profile_; Profile* profile_;
NetworkConnect* network_connect_; ash::NetworkConnect* network_connect_;
// The ID of the currently showing notification. // The ID of the currently showing notification.
std::string showing_notification_id_; std::string showing_notification_id_;
@@ -125,8 +125,6 @@ class TetherNotificationPresenter : public NotificationPresenter {
base::WeakPtrFactory<TetherNotificationPresenter> weak_ptr_factory_{this}; base::WeakPtrFactory<TetherNotificationPresenter> weak_ptr_factory_{this};
}; };
} // namespace tether } // namespace chromeos::tether
} // namespace chromeos
#endif // CHROME_BROWSER_UI_ASH_NETWORK_TETHER_NOTIFICATION_PRESENTER_H_ #endif // CHROME_BROWSER_UI_ASH_NETWORK_TETHER_NOTIFICATION_PRESENTER_H_

@@ -7,7 +7,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "dbus/object_path.h" #include "dbus/object_path.h"
namespace chromeos { namespace ash {
namespace { namespace {
// Keys used by ToDictionaryValue() and FromDictionaryValue(). // Keys used by ToDictionaryValue() and FromDictionaryValue().
@@ -116,4 +116,4 @@ bool CellularESimProfile::operator!=(const CellularESimProfile& other) const {
return !(*this == other); return !(*this == other);
} }
} // namespace chromeos } // namespace ash

@@ -12,7 +12,7 @@
#include "dbus/object_path.h" #include "dbus/object_path.h"
#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/abseil-cpp/absl/types/optional.h"
namespace chromeos { namespace ash {
// Metadata representing an eSIM profile. // Metadata representing an eSIM profile.
class COMPONENT_EXPORT(CHROMEOS_NETWORK) CellularESimProfile { class COMPONENT_EXPORT(CHROMEOS_NETWORK) CellularESimProfile {
@@ -92,11 +92,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) CellularESimProfile {
std::string activation_code_; std::string activation_code_;
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove after the migration is finished.
namespace ash {
using ::chromeos::CellularESimProfile;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_CELLULAR_ESIM_PROFILE_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_CELLULAR_ESIM_PROFILE_H_

@@ -10,7 +10,7 @@
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/abseil-cpp/absl/types/optional.h"
namespace chromeos { namespace ash {
TEST(CellularESimProfileTest, ConvertToAndFromDictionary) { TEST(CellularESimProfileTest, ConvertToAndFromDictionary) {
CellularESimProfile profile(CellularESimProfile::State::kPending, CellularESimProfile profile(CellularESimProfile::State::kPending,
@@ -48,4 +48,4 @@ TEST(CellularESimProfileTest, InvalidDictionary) {
EXPECT_FALSE(from_dictionary); EXPECT_FALSE(from_dictionary);
} }
} // namespace chromeos } // namespace ash

@@ -8,8 +8,6 @@
#include <vector> #include <vector>
#include "base/component_export.h" #include "base/component_export.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/cellular_esim_profile.h"
#include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/device_state.h"
namespace dbus { namespace dbus {
@@ -18,6 +16,8 @@ class ObjectPath;
namespace ash { namespace ash {
class CellularESimProfile;
// Generates a list of CellularESimProfile objects for all Hermes esim profile // Generates a list of CellularESimProfile objects for all Hermes esim profile
// objects available through its dbus clients. Note that this function returns // objects available through its dbus clients. Note that this function returns
// an empty array if CellularESimProfileHandler::RefreshProfileList has not // an empty array if CellularESimProfileHandler::RefreshProfileList has not

@@ -16,8 +16,7 @@
#include "net/cert/nss_cert_database_chromeos.h" #include "net/cert/nss_cert_database_chromeos.h"
#include "net/cert/x509_util_nss.h" #include "net/cert/x509_util_nss.h"
namespace chromeos { namespace ash::certificate {
namespace certificate {
namespace { namespace {
@@ -93,5 +92,4 @@ std::string GetCertAsciiNameOrNickname(CERTCertificate* cert_handle) {
return Stringize(CERT_GetCommonName(&cert_handle->subject), alternative_text); return Stringize(CERT_GetCommonName(&cert_handle->subject), alternative_text);
} }
} // namespace certificate } // namespace ash::certificate
} // namespace chromeos

@@ -11,8 +11,7 @@
#include "base/component_export.h" #include "base/component_export.h"
#include "net/cert/cert_type.h" #include "net/cert/cert_type.h"
namespace chromeos { namespace ash::certificate {
namespace certificate {
// Selected functions from chrome/common/net/x509_certificate_model.cc // Selected functions from chrome/common/net/x509_certificate_model.cc
@@ -50,12 +49,6 @@ std::string GetCertAsciiSubjectCommonName(CERTCertificate* cert_handle);
COMPONENT_EXPORT(CHROMEOS_NETWORK) COMPONENT_EXPORT(CHROMEOS_NETWORK)
std::string GetCertAsciiNameOrNickname(CERTCertificate* cert_handle); std::string GetCertAsciiNameOrNickname(CERTCertificate* cert_handle);
} // namespace certificate } // namespace ash::certificate
} // namespace chromeos
// TODO(https://crbug.com/1164001): remove when it moved to ash.
namespace ash {
namespace certificate = ::chromeos::certificate;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_CERTIFICATE_HELPER_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_CERTIFICATE_HELPER_H_

@@ -11,7 +11,7 @@
#include "net/test/test_with_task_environment.h" #include "net/test/test_with_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace chromeos { namespace ash {
// Required to register an observer from the constructor of // Required to register an observer from the constructor of
// net::NSSCertDatabase. // net::NSSCertDatabase.
@@ -89,4 +89,4 @@ TEST_F(CertificateHelperTest, GetTypeServer) {
EXPECT_EQ(net::SERVER_CERT, certificate::GetCertType(cert.get())); EXPECT_EQ(net::SERVER_CERT, certificate::GetCertType(cert.get()));
} }
} // namespace chromeos } // namespace ash

@@ -17,7 +17,7 @@
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "chromeos/dbus/permission_broker/permission_broker_client.h" #include "chromeos/dbus/permission_broker/permission_broker_client.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -121,4 +121,4 @@ FirewallHole::FirewallHole(PortType type,
interface_(interface), interface_(interface),
lifeline_fd_(std::move(lifeline_fd)) {} lifeline_fd_(std::move(lifeline_fd)) {}
} // namespace chromeos } // namespace ash

@@ -14,7 +14,7 @@
#include "base/component_export.h" #include "base/component_export.h"
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
namespace chromeos { namespace ash {
// This class works with the Chrome OS permission broker to open a port in the // This class works with the Chrome OS permission broker to open a port in the
// system firewall. It is closed on destruction. // system firewall. It is closed on destruction.
@@ -58,11 +58,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FirewallHole {
base::ScopedFD lifeline_fd_; base::ScopedFD lifeline_fd_;
}; };
} // namespace chromeos
// TODO(https://crbug.com/1164001): remove when moved to ash.
namespace ash {
using ::chromeos::FirewallHole;
} // namespace ash } // namespace ash
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_FIREWALL_HOLE_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_FIREWALL_HOLE_H_

@@ -14,9 +14,11 @@
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace chromeos { namespace ash {
namespace { namespace {
using ::chromeos::FakePermissionBrokerClient;
void CopyFirewallHole(base::RunLoop* run_loop, void CopyFirewallHole(base::RunLoop* run_loop,
std::unique_ptr<FirewallHole>* out_hole, std::unique_ptr<FirewallHole>* out_hole,
std::unique_ptr<FirewallHole> hole) { std::unique_ptr<FirewallHole> hole) {
@@ -86,4 +88,4 @@ TEST_F(FirewallHoleTest, DenyUdpPortAccess) {
} }
} // namespace } // namespace
} // namespace chromeos } // namespace ash

@@ -14,8 +14,6 @@
#include "chromeos/ash/components/network/client_cert_util.h" #include "chromeos/ash/components/network/client_cert_util.h"
#include "chromeos/ash/components/network/network_handler.h" #include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_handler_callbacks.h" #include "chromeos/ash/components/network/network_handler_callbacks.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_profile.h"
#include "components/onc/onc_constants.h" #include "components/onc/onc_constants.h"
namespace base { namespace base {
@@ -27,6 +25,7 @@ namespace ash {
class NetworkConfigurationHandler; class NetworkConfigurationHandler;
class NetworkDeviceHandler; class NetworkDeviceHandler;
class NetworkPolicyObserver; class NetworkPolicyObserver;
struct NetworkProfile;
class NetworkProfileHandler; class NetworkProfileHandler;
class NetworkStateHandler; class NetworkStateHandler;

@@ -17,8 +17,6 @@
#include "chromeos/ash/components/network/client_cert_util.h" #include "chromeos/ash/components/network/client_cert_util.h"
#include "chromeos/ash/components/network/managed_network_configuration_handler.h" #include "chromeos/ash/components/network/managed_network_configuration_handler.h"
#include "chromeos/ash/components/network/network_handler_callbacks.h" #include "chromeos/ash/components/network/network_handler_callbacks.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_profile.h"
#include "chromeos/ash/components/network/network_profile_observer.h" #include "chromeos/ash/components/network/network_profile_observer.h"
#include "chromeos/ash/components/network/policy_applicator.h" #include "chromeos/ash/components/network/policy_applicator.h"
#include "chromeos/ash/components/network/profile_policies.h" #include "chromeos/ash/components/network/profile_policies.h"
@@ -32,6 +30,7 @@ namespace ash {
class CellularPolicyHandler; class CellularPolicyHandler;
class ManagedCellularPrefHandler; class ManagedCellularPrefHandler;
class NetworkConfigurationHandler; class NetworkConfigurationHandler;
struct NetworkProfile;
class NetworkProfileHandler; class NetworkProfileHandler;
class NetworkStateHandler; class NetworkStateHandler;

@@ -28,7 +28,7 @@
#include "net/cert/nss_cert_database_chromeos.h" #include "net/cert/nss_cert_database_chromeos.h"
#include "net/cert/x509_util_nss.h" #include "net/cert/x509_util_nss.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -591,4 +591,4 @@ void NetworkCertLoader::OnPolicyProvidedCertsChanged() {
UpdateCertificates(); UpdateCertificates();
} }
} // namespace chromeos } // namespace ash

@@ -22,7 +22,7 @@ namespace net {
class NSSCertDatabase; class NSSCertDatabase;
} }
namespace chromeos { namespace ash {
// This class is responsible for loading certificates once the TPM is // This class is responsible for loading certificates once the TPM is
// initialized. It is expected to be constructed on the UI thread and public // initialized. It is expected to be constructed on the UI thread and public
@@ -276,12 +276,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkCertLoader
base::WeakPtrFactory<NetworkCertLoader> weak_factory_{this}; base::WeakPtrFactory<NetworkCertLoader> weak_factory_{this};
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos // TODO(https://crbug.com/1164001): remove when the migration is finished.
// source migration is finished. namespace chromeos {
namespace ash { using ::ash::NetworkCertLoader;
using ::chromeos::NetworkCertLoader;
} }
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_LOADER_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CERT_LOADER_H_

@@ -24,7 +24,7 @@
#include "net/test/test_data_directory.h" #include "net/test/test_data_directory.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace chromeos { namespace ash {
namespace { namespace {
class FakePolicyCertificateProvider : public PolicyCertificateProvider { class FakePolicyCertificateProvider : public PolicyCertificateProvider {
@@ -873,4 +873,4 @@ TEST_F(NetworkCertLoaderTest, NoUpdateWhenShuttingDown) {
ASSERT_EQ(0U, GetAndResetCertificatesLoadedEventsCount()); ASSERT_EQ(0U, GetAndResetCertificatesLoadedEventsCount());
} }
} // namespace chromeos } // namespace ash

@@ -25,7 +25,7 @@
#include "chromeos/login/login_state/login_state.h" #include "chromeos/login/login_state/login_state.h"
#include "third_party/cros_system_api/dbus/service_constants.h" #include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -554,4 +554,4 @@ NetworkConnect::NetworkConnect() = default;
NetworkConnect::~NetworkConnect() = default; NetworkConnect::~NetworkConnect() = default;
} // namespace chromeos } // namespace ash

@@ -8,14 +8,14 @@
#include <string> #include <string>
#include "base/component_export.h" #include "base/component_export.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_type_pattern.h"
namespace base { namespace base {
class Value; class Value;
} }
namespace chromeos { namespace ash {
class NetworkTypePattern;
// NetworkConnect is a state machine designed to handle the complex UI flows // NetworkConnect is a state machine designed to handle the complex UI flows
// associated with connecting to a network (and related tasks). Any showing // associated with connecting to a network (and related tasks). Any showing
@@ -81,9 +81,8 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkConnect {
// Enables or disables a network technology. If |technology| refers to // Enables or disables a network technology. If |technology| refers to
// cellular and the device cannot be enabled due to a SIM lock, this function // cellular and the device cannot be enabled due to a SIM lock, this function
// will launch the SIM unlock dialog. // will launch the SIM unlock dialog.
virtual void SetTechnologyEnabled( virtual void SetTechnologyEnabled(const NetworkTypePattern& technology,
const chromeos::NetworkTypePattern& technology, bool enabled_state) = 0;
bool enabled_state) = 0;
// Determines whether or not a network requires a connection to activate or // Determines whether or not a network requires a connection to activate or
// setup and either shows a notification or opens the mobile setup dialog. // setup and either shows a notification or opens the mobile setup dialog.
@@ -115,11 +114,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkConnect {
NetworkConnect(); NetworkConnect();
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove when moved to ash // TODO(https://crbug.com/1164001): remove when the migration is finished.
namespace ash { namespace chromeos {
using ::chromeos::NetworkConnect; using ::ash::NetworkConnect;
} }
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECT_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_CONNECT_H_

@@ -29,7 +29,7 @@ using testing::AnyNumber;
using testing::NiceMock; using testing::NiceMock;
using testing::Return; using testing::Return;
namespace chromeos { namespace ash {
namespace { namespace {
@@ -339,4 +339,4 @@ TEST_F(NetworkConnectTest, ConnectToCellularNetwork_SimLocked) {
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
} // namespace chromeos } // namespace ash

@@ -6,7 +6,7 @@
#include "base/notreached.h" #include "base/notreached.h"
namespace chromeos { namespace ash {
namespace { namespace {
#define ENUM_CASE(x) case x: return std::string(#x) #define ENUM_CASE(x) case x: return std::string(#x)
@@ -50,4 +50,4 @@ std::string NetworkIPConfig::ToString() const {
+ " name_servers: " + name_servers; + " name_servers: " + name_servers;
} }
} // namespace chromeos } // namespace ash

@@ -11,7 +11,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/component_export.h" #include "base/component_export.h"
namespace chromeos { namespace ash {
// ipconfig types (see flimflam/files/doc/ipconfig-api.txt) // ipconfig types (see flimflam/files/doc/ipconfig-api.txt)
enum IPConfigType { enum IPConfigType {
@@ -44,6 +44,6 @@ struct COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkIPConfig {
typedef std::vector<NetworkIPConfig> NetworkIPConfigVector; typedef std::vector<NetworkIPConfig> NetworkIPConfigVector;
} // namespace chromeos } // namespace ash
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_IP_CONFIG_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_IP_CONFIG_H_

@@ -7,7 +7,7 @@
#include "base/notreached.h" #include "base/notreached.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
namespace chromeos { namespace ash {
std::string NetworkProfile::ToDebugString() const { std::string NetworkProfile::ToDebugString() const {
if (type() == NetworkProfile::TYPE_SHARED) { if (type() == NetworkProfile::TYPE_SHARED) {
@@ -22,4 +22,4 @@ std::string NetworkProfile::ToDebugString() const {
return std::string(); return std::string();
} }
} // namespace chromeos } // namespace ash

@@ -9,7 +9,7 @@
#include "base/component_export.h" #include "base/component_export.h"
namespace chromeos { namespace ash {
struct COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkProfile { struct COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkProfile {
enum Type { enum Type {
@@ -33,11 +33,11 @@ struct COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkProfile {
std::string ToDebugString() const; std::string ToDebugString() const;
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove when it moved to ash. // TODO(https://crbug.com/1164001): remove when the migration is finished.
namespace ash { namespace chromeos {
using ::chromeos::NetworkProfile; using ::ash::NetworkProfile;
} }
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_PROFILE_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_PROFILE_H_

@@ -5,11 +5,10 @@
#ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_PROFILE_OBSERVER_H_ #ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_PROFILE_OBSERVER_H_
#define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_PROFILE_OBSERVER_H_ #define CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_PROFILE_OBSERVER_H_
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_profile.h"
namespace ash { namespace ash {
struct NetworkProfile;
class NetworkProfileObserver { class NetworkProfileObserver {
public: public:
NetworkProfileObserver& operator=(const NetworkProfileObserver&) = delete; NetworkProfileObserver& operator=(const NetworkProfileObserver&) = delete;

@@ -11,7 +11,7 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/values.h" #include "base/values.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -131,4 +131,4 @@ std::string NetworkUIData::GetONCSourceAsString() const {
return EnumToString(kONCSourceTable, onc_source_); return EnumToString(kONCSourceTable, onc_source_);
} }
} // namespace chromeos } // namespace ash

@@ -12,7 +12,7 @@
#include "base/values.h" #include "base/values.h"
#include "components/onc/onc_constants.h" #include "components/onc/onc_constants.h"
namespace chromeos { namespace ash {
// Helper for accessing and setting values in the network's UI data dictionary. // Helper for accessing and setting values in the network's UI data dictionary.
// Accessing values is done via static members that take the network as an // Accessing values is done via static members that take the network as an
@@ -51,11 +51,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkUIData {
base::Value user_settings_; base::Value user_settings_;
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove when it moved to ash.
namespace ash {
using ::chromeos::NetworkUIData;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_UI_DATA_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_NETWORK_UI_DATA_H_

@@ -7,7 +7,7 @@
#include "base/values.h" #include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace chromeos { namespace ash {
TEST(NetworkUIDataTest, ONCSource) { TEST(NetworkUIDataTest, ONCSource) {
base::Value ui_data_dict(base::Value::Type::DICTIONARY); base::Value ui_data_dict(base::Value::Type::DICTIONARY);
@@ -30,4 +30,4 @@ TEST(NetworkUIDataTest, ONCSource) {
} }
} }
} // namespace chromeos } // namespace ash

@@ -20,13 +20,12 @@
#include "base/component_export.h" #include "base/component_export.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h" #include "base/values.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_state.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_type_pattern.h"
namespace ash { namespace ash {
class NetworkState;
class NetworkTypePattern;
// Struct for passing wifi access point data. // Struct for passing wifi access point data.
struct COMPONENT_EXPORT(CHROMEOS_NETWORK) WifiAccessPoint { struct COMPONENT_EXPORT(CHROMEOS_NETWORK) WifiAccessPoint {
WifiAccessPoint(); WifiAccessPoint();

@@ -28,7 +28,7 @@
#include "dbus/object_path.h" #include "dbus/object_path.h"
#include "third_party/cros_system_api/dbus/service_constants.h" #include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -471,4 +471,4 @@ void PolicyApplicator::NotifyConfigurationHandlerAndFinish() {
handler_->OnPoliciesApplied(profile_, new_cellular_policy_guids_); handler_->OnPoliciesApplied(profile_, new_cellular_policy_guids_);
} }
} // namespace chromeos } // namespace ash

@@ -15,12 +15,11 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "base/values.h" #include "base/values.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/managed_cellular_pref_handler.h"
#include "chromeos/ash/components/network/network_profile.h" #include "chromeos/ash/components/network/network_profile.h"
namespace chromeos { namespace ash {
class ManagedCellularPrefHandler;
class NetworkUIData; class NetworkUIData;
// This class compares (entry point is Run()) |modified_policies| with the // This class compares (entry point is Run()) |modified_policies| with the
@@ -166,11 +165,6 @@ class PolicyApplicator {
base::WeakPtrFactory<PolicyApplicator> weak_ptr_factory_{this}; base::WeakPtrFactory<PolicyApplicator> weak_ptr_factory_{this};
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove when it moved to ash.
namespace ash {
using ::chromeos::PolicyApplicator;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_POLICY_APPLICATOR_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_POLICY_APPLICATOR_H_

@@ -17,7 +17,7 @@ class X509Certificate;
using CertificateList = std::vector<scoped_refptr<X509Certificate>>; using CertificateList = std::vector<scoped_refptr<X509Certificate>>;
} // namespace net } // namespace net
namespace chromeos { namespace ash {
// An interface for a class which makes server and authority certificates // An interface for a class which makes server and authority certificates
// available from enterprise policy. Clients of this interface can register as // available from enterprise policy. Clients of this interface can register as
@@ -70,6 +70,6 @@ class PolicyCertificateProvider {
const = 0; const = 0;
}; };
} // namespace chromeos } // namespace ash
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_POLICY_CERTIFICATE_PROVIDER_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_POLICY_CERTIFICATE_PROVIDER_H_

@@ -8,14 +8,16 @@
#include <string> #include <string>
#include "base/component_export.h" #include "base/component_export.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_profile.h"
namespace base { namespace base {
class Value; class Value;
} }
namespace ash::policy_util { namespace ash {
struct NetworkProfile;
namespace policy_util {
// This fake credential contains a random postfix which is extremely unlikely to // This fake credential contains a random postfix which is extremely unlikely to
// be used by any user. Used to determine saved but unknown credential // be used by any user. Used to determine saved but unknown credential
@@ -72,7 +74,8 @@ const std::string* GetIccidFromONC(const base::Value& onc_config);
// If there is no SMDPAddress, returns nullptr. // If there is no SMDPAddress, returns nullptr.
const std::string* GetSMDPAddressFromONC(const base::Value& onc_config); const std::string* GetSMDPAddressFromONC(const base::Value& onc_config);
} // namespace ash::policy_util } // namespace policy_util
} // namespace ash
// TODO(https://crbug.com/1164001): remove when the migration is finished. // TODO(https://crbug.com/1164001): remove when the migration is finished.
namespace chromeos { namespace chromeos {

@@ -19,7 +19,7 @@
#include "components/onc/onc_constants.h" #include "components/onc/onc_constants.h"
#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/abseil-cpp/absl/types/optional.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -272,4 +272,4 @@ const ProfilePolicies::NetworkPolicy* ProfilePolicies::FindPolicy(
return iter != guid_to_policy_.end() ? &(iter->second) : nullptr; return iter != guid_to_policy_.end() ? &(iter->second) : nullptr;
} }
} // namespace chromeos } // namespace ash

@@ -15,7 +15,7 @@
#include "chromeos/ash/components/network/client_cert_util.h" #include "chromeos/ash/components/network/client_cert_util.h"
#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/abseil-cpp/absl/types/optional.h"
namespace chromeos { namespace ash {
// Stores network policies for a shill profile. // Stores network policies for a shill profile.
// Understands some ONC (OpenNetworkConfiguration) concepts such as // Understands some ONC (OpenNetworkConfiguration) concepts such as
@@ -200,11 +200,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ProfilePolicies {
base::flat_map<std::string, std::string> profile_wide_expansions_; base::flat_map<std::string, std::string> profile_wide_expansions_;
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove when it moved to ash.
namespace ash {
using ::chromeos::ProfilePolicies;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_PROFILE_POLICIES_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_PROFILE_POLICIES_H_

@@ -13,7 +13,7 @@
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -584,4 +584,4 @@ TEST(ProfilePoliciesTest, SetResolvedClientCertificateUnknownGuid) {
EXPECT_FALSE(change_had_effect); EXPECT_FALSE(change_had_effect);
} }
} // namespace chromeos } // namespace ash

@@ -26,7 +26,7 @@
#include "dbus/object_path.h" #include "dbus/object_path.h"
#include "third_party/cros_system_api/dbus/service_constants.h" #include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -120,4 +120,4 @@ void SetProxyConfigForNetwork(const ProxyConfigDictionary& proxy_config,
} // namespace proxy_config } // namespace proxy_config
} // namespace chromeos } // namespace ash

@@ -8,16 +8,15 @@
#include <memory> #include <memory>
#include "base/component_export.h" #include "base/component_export.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_profile_handler.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_state.h"
#include "components/onc/onc_constants.h" #include "components/onc/onc_constants.h"
class PrefService; class PrefService;
class ProxyConfigDictionary; class ProxyConfigDictionary;
namespace chromeos { namespace ash {
class NetworkProfileHandler;
class NetworkState;
namespace proxy_config { namespace proxy_config {
@@ -38,15 +37,6 @@ void SetProxyConfigForNetwork(const ProxyConfigDictionary& proxy_config,
const NetworkState& network); const NetworkState& network);
} // namespace proxy_config } // namespace proxy_config
} // namespace chromeos
// TODO(https://crbug.com/1164001): remove after the migration is finished.
namespace ash {
namespace proxy_config {
using ::chromeos::proxy_config::GetProxyConfigForNetwork;
using ::chromeos::proxy_config::SetProxyConfigForNetwork;
} // namespace proxy_config
} // namespace ash } // namespace ash
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_PROXY_PROXY_CONFIG_HANDLER_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_PROXY_PROXY_CONFIG_HANDLER_H_

@@ -26,7 +26,7 @@
#include "components/proxy_config/proxy_prefs.h" #include "components/proxy_config/proxy_prefs.h"
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -281,4 +281,4 @@ void ProxyConfigServiceImpl::DetermineEffectiveConfigFromDefaultNetwork() {
} }
} }
} // namespace chromeos } // namespace ash

@@ -10,14 +10,14 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/component_export.h" #include "base/component_export.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_state.h"
#include "chromeos/ash/components/network/network_state_handler_observer.h" #include "chromeos/ash/components/network/network_state_handler_observer.h"
#include "components/onc/onc_constants.h" #include "components/onc/onc_constants.h"
#include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_change_registrar.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
namespace chromeos { namespace ash {
class NetworkState;
// Implementation of proxy config service for chromeos that: // Implementation of proxy config service for chromeos that:
// - extends PrefProxyConfigTrackerImpl (and so lives and runs entirely on UI // - extends PrefProxyConfigTrackerImpl (and so lives and runs entirely on UI
@@ -105,11 +105,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ProxyConfigServiceImpl
base::WeakPtrFactory<ProxyConfigServiceImpl> pointer_factory_{this}; base::WeakPtrFactory<ProxyConfigServiceImpl> pointer_factory_{this};
}; };
} // namespace chromeos } // namespace ash
// TODO(https://crbug.com/1164001): remove after the migration is finished.
namespace ash {
using ::chromeos::ProxyConfigServiceImpl;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_PROXY_PROXY_CONFIG_SERVICE_IMPL_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_PROXY_PROXY_CONFIG_SERVICE_IMPL_H_

@@ -17,7 +17,7 @@
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace chromeos { namespace ash {
namespace { namespace {
const char kFixedPacUrl[] = "http://fixed/"; const char kFixedPacUrl[] = "http://fixed/";
@@ -123,4 +123,4 @@ TEST_F(ProxyConfigServiceImplTest, UsesNestedProxyConfigService) {
proxy_tracker.DetachFromPrefService(); proxy_tracker.DetachFromPrefService();
} }
} // namespace chromeos } // namespace ash

@@ -9,15 +9,17 @@
#include <string> #include <string>
#include "base/component_export.h" #include "base/component_export.h"
// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/ash/components/network/network_ui_data.h"
#include "components/onc/onc_constants.h" #include "components/onc/onc_constants.h"
namespace base { namespace base {
class Value; class Value;
} }
namespace ash::shill_property_util { namespace ash {
class NetworkUIData;
namespace shill_property_util {
// Sets the |ssid| in |properties|. // Sets the |ssid| in |properties|.
COMPONENT_EXPORT(CHROMEOS_NETWORK) COMPONENT_EXPORT(CHROMEOS_NETWORK)
@@ -93,7 +95,8 @@ bool DoIdentifyingPropertiesMatch(const base::Value& new_properties,
// be relied upon). // be relied upon).
bool IsLoggableShillProperty(const std::string& key); bool IsLoggableShillProperty(const std::string& key);
} // namespace ash::shill_property_util } // namespace shill_property_util
} // namespace ash
// TODO(https://crbug.com/1164001): remove when the migration is finished. // TODO(https://crbug.com/1164001): remove when the migration is finished.
namespace chromeos { namespace chromeos {

@@ -14,7 +14,7 @@
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "net/cert/nss_cert_database.h" #include "net/cert/nss_cert_database.h"
namespace chromeos { namespace ash {
namespace { namespace {
@@ -114,4 +114,4 @@ void SystemTokenCertDbStorage::OnSystemTokenDbRetrievalTimeout() {
/*nss_cert_database=*/nullptr); /*nss_cert_database=*/nullptr);
} }
} // namespace chromeos } // namespace ash

@@ -19,7 +19,7 @@ namespace net {
class NSSCertDatabase; class NSSCertDatabase;
} }
namespace chromeos { namespace ash {
// Used by SystemTokenCertDbInitializer to save the system token certificate // Used by SystemTokenCertDbInitializer to save the system token certificate
// database when it is ready. // database when it is ready.
@@ -109,11 +109,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) SystemTokenCertDbStorage {
SEQUENCE_CHECKER(sequence_checker_); SEQUENCE_CHECKER(sequence_checker_);
}; };
} // namespace chromeos
// TODO(https://crbug.com/1164001): remove when moved to ash.
namespace ash {
using ::chromeos::SystemTokenCertDbStorage;
} // namespace ash } // namespace ash
// TODO(https://crbug.com/1164001): remove when the migration is finished.
namespace chromeos {
using ::ash::SystemTokenCertDbStorage;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_SYSTEM_TOKEN_CERT_DB_STORAGE_H_ #endif // CHROMEOS_ASH_COMPONENTS_NETWORK_SYSTEM_TOKEN_CERT_DB_STORAGE_H_

@@ -17,7 +17,7 @@
#include "net/cert/nss_cert_database.h" #include "net/cert/nss_cert_database.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace chromeos { namespace ash {
class SystemTokenCertDbStorageTest : public testing::Test { class SystemTokenCertDbStorageTest : public testing::Test {
public: public:
@@ -200,4 +200,4 @@ TEST_F(SystemTokenCertDbStorageTest, RequestingDatabaseFailsAfterReset) {
get_system_token_cert_db_callback_wrapper_2.IsDbRetrievalSucceeded()); get_system_token_cert_db_callback_wrapper_2.IsDbRetrievalSucceeded());
} }
} // namespace chromeos } // namespace ash

@@ -126,6 +126,7 @@ bool ResolveServerCertRefsInNetwork(const CertPEMsByGUIDMap& certs_by_guid,
// TODO(https://crbug.com/1164001): remove when it moved to ash. // TODO(https://crbug.com/1164001): remove when it moved to ash.
namespace ash::onc { namespace ash::onc {
using ::chromeos::onc::ExpandStringsInOncObject;
using ::chromeos::onc::FillInHexSSIDField; using ::chromeos::onc::FillInHexSSIDField;
using ::chromeos::onc::FillInHexSSIDFieldsInOncObject; using ::chromeos::onc::FillInHexSSIDFieldsInOncObject;
using ::chromeos::onc::MaskCredentialsInOncObject; using ::chromeos::onc::MaskCredentialsInOncObject;

@@ -28,7 +28,7 @@ class SingleThreadTaskRunner;
// settings (pushed from PrefProxyConfigTrackerImpl) as overrides to the proxy // settings (pushed from PrefProxyConfigTrackerImpl) as overrides to the proxy
// configuration determined by a baseline delegate ProxyConfigService on // configuration determined by a baseline delegate ProxyConfigService on
// non-ChromeOS platforms. ChromeOS has its own implementation of overrides in // non-ChromeOS platforms. ChromeOS has its own implementation of overrides in
// chromeos::ProxyConfigServiceImpl. // ash::ProxyConfigServiceImpl.
class ProxyConfigServiceImpl : public net::ProxyConfigService, class ProxyConfigServiceImpl : public net::ProxyConfigService,
public net::ProxyConfigService::Observer { public net::ProxyConfigService::Observer {
public: public:

@@ -91,8 +91,8 @@ bool IsLoopbackAddress(const net::IPAddress& address) {
} // namespace } // namespace
void OpenFirewallHole(const net::IPEndPoint& address, void OpenFirewallHole(const net::IPEndPoint& address,
chromeos::FirewallHole::PortType type, ash::FirewallHole::PortType type,
chromeos::FirewallHole::OpenCallback callback) { ash::FirewallHole::OpenCallback callback) {
if (IsLoopbackAddress(address.address())) { if (IsLoopbackAddress(address.address())) {
std::move(callback).Run(nullptr); std::move(callback).Run(nullptr);
return; return;
@@ -103,19 +103,19 @@ void OpenFirewallHole(const net::IPEndPoint& address,
// can be resolved by the address, but the best solution would be to update // can be resolved by the address, but the best solution would be to update
// firewalld to allow filtering by destination address, not just destination // firewalld to allow filtering by destination address, not just destination
// port. iptables already support it. // port. iptables already support it.
chromeos::FirewallHole::Open(type, address.port(), std::string(), ash::FirewallHole::Open(type, address.port(), std::string(),
std::move(callback)); std::move(callback));
} }
void OpenTCPFirewallHole(const net::IPEndPoint& address, void OpenTCPFirewallHole(const net::IPEndPoint& address,
chromeos::FirewallHole::OpenCallback callback) { ash::FirewallHole::OpenCallback callback) {
OpenFirewallHole(address, chromeos::FirewallHole::PortType::TCP, OpenFirewallHole(address, ash::FirewallHole::PortType::TCP,
std::move(callback)); std::move(callback));
} }
void OpenUDPFirewallHole(const net::IPEndPoint& address, void OpenUDPFirewallHole(const net::IPEndPoint& address,
chromeos::FirewallHole::OpenCallback callback) { ash::FirewallHole::OpenCallback callback) {
OpenFirewallHole(address, chromeos::FirewallHole::PortType::UDP, OpenFirewallHole(address, ash::FirewallHole::PortType::UDP,
std::move(callback)); std::move(callback));
} }
#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)

@@ -45,10 +45,10 @@ bool CanUseSocketAPIs(bool external_plugin,
// Returns true if the open operation is in progress. // Returns true if the open operation is in progress.
void OpenTCPFirewallHole(const net::IPEndPoint& address, void OpenTCPFirewallHole(const net::IPEndPoint& address,
chromeos::FirewallHole::OpenCallback callback); ash::FirewallHole::OpenCallback callback);
void OpenUDPFirewallHole(const net::IPEndPoint& address, void OpenUDPFirewallHole(const net::IPEndPoint& address,
chromeos::FirewallHole::OpenCallback callback); ash::FirewallHole::OpenCallback callback);
#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Annotations for TCP and UDP network requests. Defined here to make it easier // Annotations for TCP and UDP network requests. Defined here to make it easier

@@ -275,7 +275,7 @@ void PepperTCPServerSocketMessageFilter::OpenFirewallHole(
void PepperTCPServerSocketMessageFilter::OnFirewallHoleOpened( void PepperTCPServerSocketMessageFilter::OnFirewallHoleOpened(
const ppapi::host::ReplyMessageContext& context, const ppapi::host::ReplyMessageContext& context,
std::unique_ptr<chromeos::FirewallHole> hole) { std::unique_ptr<ash::FirewallHole> hole) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
LOG_IF(WARNING, !hole.get()) << "Firewall hole could not be opened."; LOG_IF(WARNING, !hole.get()) << "Firewall hole could not be opened.";

@@ -143,7 +143,7 @@ class CONTENT_EXPORT PepperTCPServerSocketMessageFilter
void OpenFirewallHole(const ppapi::host::ReplyMessageContext& context, void OpenFirewallHole(const ppapi::host::ReplyMessageContext& context,
const net::IPEndPoint& local_addr); const net::IPEndPoint& local_addr);
void OnFirewallHoleOpened(const ppapi::host::ReplyMessageContext& context, void OnFirewallHoleOpened(const ppapi::host::ReplyMessageContext& context,
std::unique_ptr<chromeos::FirewallHole> hole); std::unique_ptr<ash::FirewallHole> hole);
#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Following fields are initialized and used only on the IO thread. // Following fields are initialized and used only on the IO thread.
@@ -161,8 +161,7 @@ class CONTENT_EXPORT PepperTCPServerSocketMessageFilter
PP_NetAddress_Private bound_addr_; PP_NetAddress_Private bound_addr_;
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<chromeos::FirewallHole, std::unique_ptr<ash::FirewallHole, content::BrowserThread::DeleteOnUIThread>
content::BrowserThread::DeleteOnUIThread>
firewall_hole_; firewall_hole_;
#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)

@@ -1200,7 +1200,7 @@ void PepperTCPSocketMessageFilter::OpenFirewallHole(
void PepperTCPSocketMessageFilter::OnFirewallHoleOpened( void PepperTCPSocketMessageFilter::OnFirewallHoleOpened(
const ppapi::host::ReplyMessageContext& context, const ppapi::host::ReplyMessageContext& context,
std::unique_ptr<chromeos::FirewallHole> hole) { std::unique_ptr<ash::FirewallHole> hole) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(state_.IsPending(TCPSocketState::LISTEN)); DCHECK(state_.IsPending(TCPSocketState::LISTEN));
LOG_IF(WARNING, !hole.get()) << "Firewall hole could not be opened."; LOG_IF(WARNING, !hole.get()) << "Firewall hole could not be opened.";

Some files were not shown because too many files have changed in this diff Show More