0

Move {chromeos => chromeos/ash}/services/network_config/

//chromeos/services/network_config/public/cpp and
fake_cros_network_config.* from
//chromeos/services/network_config/public/cpp:test_support remain in
chromeos/services/, since they don't have Ash dependencies and might
be used in Lacros in the future.

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

Bug: 1164001
Change-Id: I0939f0ca41235efa57832cd3a93f8fcaded1d80e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3874937
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Owners-Override: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1094540}
This commit is contained in:
Henrique Ferreiro
2023-01-19 17:39:03 +00:00
committed by Chromium LUCI CQ
parent 02b8c55bac
commit 57f2c50aa3
152 changed files with 864 additions and 1045 deletions
WATCHLISTS
ash
chrome
chromeos
components/onc/docs

@ -794,9 +794,7 @@
},
'chromeos_net': {
'filepath': 'ash/system/network/|'\
'chromeos/ash/components/dbus/shill/|'\
'chromeos/ash/components/network/|'\
'chromeos/services/network_config/|'\
'ash/webui/common/resources/network/|'\
'chrome/browser/ash/net/|'\
'chrome/browser/extensions/api/networking_private/|'\
'chrome/browser/resources/chromeos/internet_config_dialog/|'\
@ -806,9 +804,12 @@
'chrome/browser/ui/ash/network/|'\
'chrome/browser/ui/webui/ash/network|'\
'chrome/test/data/webui/cr_components/chromeos/network/|'\
'chromeos/ash/components/dbus/shill/|'\
'chromeos/ash/components/network/|'\
'chromeos/ash/services/network_config/|'\
'chromeos/services/network_config/|'\
'components/onc/|'\
'extensions/browser/api/networking_private/|'\
'ash/webui/common/resources/network/'
'extensions/browser/api/networking_private/',
},
'chromeos_tast_control': {
'filepath': 'chromeos/tast_control.gni',

@ -2438,6 +2438,7 @@ component("ash") {
"//chromeos/ash/services/multidevice_setup/public/mojom",
"//chromeos/crosapi/mojom",
"//chromeos/services/machine_learning/public/mojom",
"//chromeos/services/network_config/public/cpp",
"//chromeos/ui/vector_icons",
"//components/discardable_memory/public/mojom",
"//components/version_info:channel",
@ -2555,7 +2556,6 @@ component("ash") {
"//chromeos/dbus/init",
"//chromeos/dbus/power",
"//chromeos/dbus/power:power_manager_proto",
"//chromeos/services/network_config/public/cpp",
"//chromeos/services/network_config/public/mojom",
"//chromeos/strings",
"//chromeos/ui/base",
@ -3433,6 +3433,7 @@ test("ash_unittests") {
"//chromeos/ash/services/multidevice_setup/public/cpp:test_support",
"//chromeos/ash/services/multidevice_setup/public/mojom",
"//chromeos/ash/services/nearby/public/cpp",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//chromeos/ash/services/recording:test_support",
"//chromeos/components/sensors:sensors",
"//chromeos/components/sensors:test_support",
@ -3867,7 +3868,7 @@ static_library("test_support") {
public_deps = [
"//ash",
"//chromeos/ash/services/assistant/public/mojom",
"//chromeos/services/network_config/public/cpp:test_support",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//dbus",
"//testing/gtest",
"//third_party/blink/public:blink_headers",

@ -97,6 +97,7 @@ include_rules = [
"+chromeos/ash/services/nearby/public",
"+chromeos/ash/services/multidevice_setup/public",
"+chromeos/ash/services/secure_channel/public",
"+chromeos/ash/services/network_config/public",
"+chromeos/services/machine_learning/public",
"+chromeos/services/network_config/public",
"+chromeos/services/power/public",

@ -395,8 +395,8 @@ component("cpp") {
"//chromeos/ash/services/bluetooth_config:in_process_bluetooth_config",
"//chromeos/ash/services/cellular_setup:in_process_esim_manager",
"//chromeos/ash/services/hotspot_config:in_process_hotspot_config",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/dbus/power:power_manager_proto",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/strings:strings_grit",
"//chromeos/ui/base",
"//chromeos/ui/frame",

@ -4,14 +4,14 @@
#include "ash/public/cpp/network_config_service.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
namespace ash {
void GetNetworkConfigService(
mojo::PendingReceiver<chromeos::network_config::mojom::CrosNetworkConfig>
receiver) {
chromeos::network_config::BindToInProcessInstance(std::move(receiver));
network_config::BindToInProcessInstance(std::move(receiver));
}
} // namespace ash

@ -1,6 +1,5 @@
include_rules = [
"+chromeos/ash/components/dbus/hermes",
"+chromeos/services/network_config/public",
"+components/device_event_log",
"+components/onc",
"+third_party/cros_system_api",

@ -26,7 +26,6 @@ using chromeos::network_config::mojom::DeviceStateType;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
namespace ash {

@ -16,18 +16,18 @@
#include "base/strings/utf_string_conversions.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image_unittest_util.h"
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::NetworkType;
namespace ash {
namespace {
using ::chromeos::network_config::mojom::ConnectionStateType;
using ::chromeos::network_config::mojom::NetworkType;
const char kShillManagerClientStubCellularDevice[] =
"/device/stub_cellular_device";
const char kCellularNetworkGuid[] = "cellular_guid";
@ -119,10 +119,9 @@ class ActiveNetworkIconTest : public AshTestBase {
base::RunLoop().RunUntilIdle();
}
gfx::ImageSkia ImageForNetwork(
chromeos::network_config::mojom::NetworkType type,
chromeos::network_config::mojom::ConnectionStateType connection_state,
int signal_strength = 100) {
gfx::ImageSkia ImageForNetwork(NetworkType type,
ConnectionStateType connection_state,
int signal_strength = 100) {
std::string id = base::StringPrintf("reference_%d", reference_count_++);
chromeos::network_config::mojom::NetworkStatePropertiesPtr
reference_properties =
@ -167,7 +166,7 @@ class ActiveNetworkIconTest : public AshTestBase {
network_icon::IconType icon_type() { return icon_type_; }
private:
chromeos::network_config::CrosNetworkConfigTestHelper network_config_helper_;
network_config::CrosNetworkConfigTestHelper network_config_helper_;
std::unique_ptr<TrayNetworkStateModel> network_state_model_;
std::unique_ptr<ActiveNetworkIcon> active_network_icon_;

@ -21,7 +21,7 @@
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_handler_test_helper.h"
#include "chromeos/ash/components/network/system_token_cert_db_storage.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "dbus/object_path.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/base/l10n/l10n_util.h"
@ -51,8 +51,8 @@ class AutoConnectNotifierTest : public AshTestBase {
NetworkCertLoader::ForceAvailableForNetworkAuthForTesting();
network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>();
CHECK(NetworkHandler::Get()->auto_connect_handler());
network_config_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
network_config_helper_ =
std::make_unique<network_config::CrosNetworkConfigTestHelper>();
AshTestBase::SetUp();
@ -113,7 +113,7 @@ class AutoConnectNotifierTest : public AshTestBase {
private:
std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_;
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<network_config::CrosNetworkConfigTestHelper>
network_config_helper_;
ToastManagerImpl* toast_manager_ = nullptr;
};

@ -17,7 +17,7 @@
#include "chromeos/ash/components/network/network_cert_loader.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/system_token_cert_db_storage.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/prefs/pref_service.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
@ -48,8 +48,8 @@ class CellularSetupNotifierTest : public NoSessionAshTestBase {
shill_clients::InitializeFakes();
hermes_clients::InitializeFakes();
NetworkHandler::Initialize();
network_config_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
network_config_helper_ =
std::make_unique<network_config::CrosNetworkConfigTestHelper>();
AshTestBase::SetUp();
@ -109,7 +109,7 @@ class CellularSetupNotifierTest : public NoSessionAshTestBase {
// Ownership passed to Shell owned CellularSetupNotifier instance.
base::MockOneShotTimer* mock_notification_timer_;
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<network_config::CrosNetworkConfigTestHelper>
network_config_helper_;
};

@ -15,13 +15,14 @@
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_handler_test_helper.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/notification.h"
namespace ash {
namespace {
const char kTestCellularServicePath[] = "cellular_service_path";
@ -47,8 +48,8 @@ class ManagedSimLockNotifierTest : public NoSessionAshTestBase {
void SetUp() override {
network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>();
network_config_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
network_config_helper_ =
std::make_unique<network_config::CrosNetworkConfigTestHelper>();
AshTestBase::SetUp();
base::RunLoop().RunUntilIdle();
@ -161,7 +162,7 @@ class ManagedSimLockNotifierTest : public NoSessionAshTestBase {
}
base::test::ScopedFeatureList scoped_feature_list_;
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<network_config::CrosNetworkConfigTestHelper>
network_config_helper_;
std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_;
base::HistogramTester histogram_tester_;

@ -17,7 +17,7 @@
#include "ash/test/ash_test_base.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-shared.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
@ -30,11 +30,10 @@
namespace ash {
namespace {
using chromeos::network_config::CrosNetworkConfigTestHelper;
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
using ::chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using ::chromeos::network_config::mojom::NetworkType;
using network_config::CrosNetworkConfigTestHelper;
const char kStubCellularDevicePath[] = "/device/stub_cellular_device";
const char kStubCellularDeviceName[] = "stub_cellular_device";
@ -94,6 +93,7 @@ class FakeNetworkDetailedNetworkViewDelegate
size_t network_list_item_selected_count_ = 0;
NetworkStatePropertiesPtr last_network_list_item_selected_;
};
} // namespace
class NetworkDetailedNetworkViewTest : public AshTestBase {

@ -38,7 +38,6 @@ using ::chromeos::network_config::NetworkTypeMatchesType;
using ::chromeos::network_config::mojom::ActivationStateType;
using ::chromeos::network_config::mojom::CellularStateProperties;
using ::chromeos::network_config::mojom::ConnectionStateType;
using ::chromeos::network_config::mojom::DeviceStateProperties;
using ::chromeos::network_config::mojom::DeviceStateType;
using ::chromeos::network_config::mojom::NetworkStateProperties;
using ::chromeos::network_config::mojom::NetworkStatePropertiesPtr;

@ -21,7 +21,7 @@
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/services/bluetooth_config/fake_adapter_state_controller.h"
#include "chromeos/ash/services/bluetooth_config/scoped_bluetooth_config_test_helper.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
namespace ash {
@ -101,8 +101,8 @@ class NetworkDetailedViewControllerTest : public AshTestBase {
// Initialize CrosNetworkConfigTestHelper here, so we can initialize
// a unique network handler and also use NetworkConnectTestDelegate to
// initialize NetworkConnect.
network_config_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
network_config_helper_ =
std::make_unique<network_config::CrosNetworkConfigTestHelper>();
NetworkHandler::Initialize();
base::RunLoop().RunUntilIdle();
@ -264,7 +264,7 @@ class NetworkDetailedViewControllerTest : public AshTestBase {
return ash_test_helper()->bluetooth_config_test_helper();
}
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<network_config::CrosNetworkConfigTestHelper>
network_config_helper_;
std::unique_ptr<NetworkConnectTestDelegate> network_connect_delegate_;
std::unique_ptr<NetworkDetailedViewController>

@ -252,8 +252,7 @@ void NetworkFeaturePodController::UpdateButtonStateIfExists() {
TrayNetworkStateModel* model =
Shell::Get()->system_tray_model()->network_state_model();
const chromeos::network_config::mojom::NetworkStateProperties*
default_network = model->default_network();
const NetworkStateProperties* default_network = model->default_network();
const bool toggled =
default_network ||
@ -385,8 +384,7 @@ void NetworkFeaturePodController::UpdateButtonStateIfExists() {
}
std::u16string NetworkFeaturePodController::ComputeButtonLabel(
const chromeos::network_config::mojom::NetworkStateProperties* network)
const {
const NetworkStateProperties* network) const {
if (!network) {
return l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NETWORK_DISCONNECTED_LABEL);
@ -397,8 +395,7 @@ std::u16string NetworkFeaturePodController::ComputeButtonLabel(
}
std::u16string NetworkFeaturePodController::ComputeButtonSubLabel(
const chromeos::network_config::mojom::NetworkStateProperties* network)
const {
const NetworkStateProperties* network) const {
if (!network ||
network->connection_state == ConnectionStateType::kNotConnected) {
return l10n_util::GetStringUTF16(

@ -29,7 +29,7 @@
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/ash/components/network/network_type_pattern.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
@ -39,6 +39,7 @@
#include "ui/views/controls/button/image_button.h"
namespace ash {
namespace {
const char* kStubCellularDevice = "/device/stub_cellular_device";
@ -379,7 +380,7 @@ class NetworkFeaturePodControllerTest
return network_state_helper()->ConfigureService(shill_json_string);
}
chromeos::network_config::CrosNetworkConfigTestHelper network_config_helper_;
network_config::CrosNetworkConfigTestHelper network_config_helper_;
base::test::ScopedFeatureList feature_list_;
std::string cellular_path_;
std::string ethernet_path_;

@ -18,7 +18,7 @@
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/ash/components/network/tether_constants.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image_unittest_util.h"
@ -26,15 +26,13 @@
// This tests both the helper functions in network_icon, and ActiveNetworkIcon
// which is a primary consumer of the helper functions.
namespace ash::network_icon {
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
namespace ash {
namespace network_icon {
class NetworkIconTest : public AshTestBase {
public:
NetworkIconTest() = default;
@ -156,7 +154,7 @@ class NetworkIconTest : public AshTestBase {
IconType icon_type_ = ICON_TYPE_TRAY_REGULAR;
private:
chromeos::network_config::CrosNetworkConfigTestHelper network_config_helper_;
network_config::CrosNetworkConfigTestHelper network_config_helper_;
std::unique_ptr<TrayNetworkStateModel> network_state_model_;
std::unique_ptr<ActiveNetworkIcon> active_network_icon_;
@ -660,6 +658,4 @@ TEST_F(NetworkIconTest, DefaultNetworkImageVpnAndCellular) {
gfx::Image(default_image), ImageForNetwork(reference_network.get())));
}
} // namespace network_icon
} // namespace ash
} // namespace ash::network_icon

@ -20,6 +20,7 @@
#include "ui/views/view.h"
namespace ash {
namespace {
using chromeos::network_config::mojom::DeviceStateProperties;

@ -16,7 +16,7 @@
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/event.h"
@ -25,9 +25,8 @@
#include "ui/views/view.h"
namespace ash {
namespace {
using chromeos::network_config::CrosNetworkConfigTestHelper;
namespace {
const char kIPv4ConfigPath[] = "/ipconfig/stub_ipv4_config";
const char kIPv6ConfigPath[] = "/ipconfig/stub_ipv6_config";
@ -193,7 +192,7 @@ class NetworkInfoBubbleTest : public AshTestBase {
FakeNetworkInfoBubbleDelegate* fake_delegate() { return &fake_delegate_; }
private:
CrosNetworkConfigTestHelper network_config_helper_;
network_config::CrosNetworkConfigTestHelper network_config_helper_;
FakeNetworkInfoBubbleDelegate fake_delegate_;
NetworkInfoBubble* network_info_bubble_ = nullptr;
base::test::ScopedFeatureList feature_list_;

@ -26,10 +26,10 @@
#include "ui/views/view.h"
namespace ash {
namespace {
using chromeos::network_config::mojom::DeviceStateProperties;
using chromeos::network_config::mojom::DeviceStateType;
using chromeos::network_config::mojom::NetworkType;
int GetAddESimTooltipMessageId() {

@ -19,7 +19,7 @@
#include "chromeos/ash/components/network/network_device_handler.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_type_pattern.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "components/onc/onc_constants.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/base/l10n/l10n_util.h"
@ -34,8 +34,6 @@ namespace ash {
namespace {
using chromeos::network_config::CrosNetworkConfigTestHelper;
const char kStubCellularDevicePath[] = "/device/stub_cellular_device";
const char kStubCellularDeviceName[] = "stub_cellular_device";
@ -132,7 +130,7 @@ class NetworkListMobileHeaderViewTest : public AshTestBase {
}
std::unique_ptr<views::Widget> widget_;
CrosNetworkConfigTestHelper network_config_helper_;
network_config::CrosNetworkConfigTestHelper network_config_helper_;
base::test::ScopedFeatureList feature_list_;
FakeNetworkListNetworkHeaderViewDelegate
fake_network_list_network_header_delegate_;

@ -38,22 +38,19 @@
#include "ui/views/view_utils.h"
namespace ash {
namespace {
using chromeos::network_config::IsInhibited;
using chromeos::network_config::NetworkTypeMatchesType;
using chromeos::network_config::StateIsConnected;
using chromeos::network_config::mojom::ActivationStateType;
using chromeos::network_config::mojom::CellularStateProperties;
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
using chromeos::network_config::mojom::OncSource;
using chromeos::network_config::mojom::PortalState;
using chromeos::network_config::mojom::ProxyMode;
using chromeos::network_config::mojom::SecurityType;
using ::chromeos::network_config::IsInhibited;
using ::chromeos::network_config::NetworkTypeMatchesType;
using ::chromeos::network_config::StateIsConnected;
using ::chromeos::network_config::mojom::ActivationStateType;
using ::chromeos::network_config::mojom::CellularStateProperties;
using ::chromeos::network_config::mojom::ConnectionStateType;
using ::chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using ::chromeos::network_config::mojom::NetworkType;
using ::chromeos::network_config::mojom::OncSource;
using ::chromeos::network_config::mojom::SecurityType;
const int kMobileNetworkBatteryIconSize = 20;
const int kPowerStatusPaddingRight = 10;

@ -20,7 +20,7 @@
#include "base/functional/bind.h"
#include "base/i18n/number_formatting.h"
#include "base/test/scoped_feature_list.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/base/l10n/l10n_util.h"
@ -36,15 +36,14 @@ namespace ash {
namespace {
using chromeos::network_config::CrosNetworkConfigTestHelper;
using chromeos::network_config::mojom::ActivationStateType;
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
using chromeos::network_config::mojom::OncSource;
using chromeos::network_config::mojom::PortalState;
using chromeos::network_config::mojom::SecurityType;
using ::chromeos::network_config::mojom::ActivationStateType;
using ::chromeos::network_config::mojom::ConnectionStateType;
using ::chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using ::chromeos::network_config::mojom::NetworkType;
using ::chromeos::network_config::mojom::OncSource;
using ::chromeos::network_config::mojom::PortalState;
using ::chromeos::network_config::mojom::SecurityType;
using network_config::CrosNetworkConfigTestHelper;
const std::string kWiFiName = "WiFi";
const std::string kCellularName = "cellular";

@ -45,25 +45,24 @@
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/separator.h"
using chromeos::network_config::IsInhibited;
using chromeos::network_config::NetworkTypeMatchesType;
using chromeos::network_config::StateIsConnected;
using chromeos::network_config::mojom::ActivationStateType;
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::DeviceStatePropertiesPtr;
using chromeos::network_config::mojom::DeviceStateType;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
using chromeos::network_config::mojom::OncSource;
using chromeos::network_config::mojom::ProxyMode;
namespace ash {
namespace {
using ::chromeos::network_config::IsInhibited;
using ::chromeos::network_config::NetworkTypeMatchesType;
using ::chromeos::network_config::StateIsConnected;
using ::chromeos::network_config::mojom::ActivationStateType;
using ::chromeos::network_config::mojom::ConnectionStateType;
using ::chromeos::network_config::mojom::DeviceStateType;
using ::chromeos::network_config::mojom::FilterType;
using ::chromeos::network_config::mojom::NetworkFilter;
using ::chromeos::network_config::mojom::NetworkStateProperties;
using ::chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using ::chromeos::network_config::mojom::NetworkType;
using ::chromeos::network_config::mojom::OncSource;
using ::chromeos::network_config::mojom::ProxyMode;
const int kMobileNetworkBatteryIconSize = 20;
const int kPowerStatusPaddingRight = 10;
const double kAlphaValueForInhibitedIconOpacity = 0.3;
@ -251,8 +250,9 @@ void NetworkListView::OnGetNetworkStateList(
for (auto& network : networks) {
ConnectionStateType connection_state = network->connection_state;
if (network->type == NetworkType::kVPN) {
if (chromeos::network_config::StateIsConnected(connection_state))
if (StateIsConnected(connection_state)) {
vpn_connected_ = true;
}
continue;
}

@ -42,7 +42,6 @@ using bluetooth_config::mojom::BluetoothSystemPropertiesPtr;
using bluetooth_config::mojom::BluetoothSystemState;
using ::chromeos::network_config::NetworkTypeMatchesType;
using ::chromeos::network_config::StateIsConnected;
using ::chromeos::network_config::mojom::CrosNetworkConfig;
using ::chromeos::network_config::mojom::DeviceStateProperties;
using ::chromeos::network_config::mojom::DeviceStateType;
using ::chromeos::network_config::mojom::FilterType;

@ -33,7 +33,7 @@
#include "chromeos/ash/services/bluetooth_config/fake_adapter_state_controller.h"
#include "chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h"
#include "chromeos/ash/services/bluetooth_config/scoped_bluetooth_config_test_helper.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "chromeos/services/network_config/public/cpp/fake_cros_network_config.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
@ -71,11 +71,8 @@ using ::chromeos::network_config::mojom::PolicySource;
using ::chromeos::network_config::mojom::SIMInfoPtr;
using ::chromeos::network_config::mojom::VpnProviderPtr;
using network_config::CrosNetworkConfigTestHelper;
using ::testing::_;
using ::testing::IsNull;
using ::testing::NotNull;
using ::testing::Return;
const std::string kCellularName = "cellular";
const std::string kCellularName2 = "cellular_2";

@ -24,10 +24,6 @@
#include "ui/views/view.h"
namespace ash {
namespace {
using chromeos::network_config::mojom::DeviceStateType;
using chromeos::network_config::mojom::NetworkType;
} // namespace
NetworkListWifiHeaderViewImpl::NetworkListWifiHeaderViewImpl(
NetworkListNetworkHeaderView::Delegate* delegate)

@ -15,17 +15,13 @@
#include "ash/test/ash_test_base.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/label.h"
#include "ui/views/widget/widget.h"
namespace ash {
namespace {
using chromeos::network_config::CrosNetworkConfigTestHelper;
} // namespace
class NetworkListWifiHeaderViewTest : public AshTestBase {
public:
NetworkListWifiHeaderViewTest() = default;
@ -98,7 +94,7 @@ class NetworkListWifiHeaderViewTest : public AshTestBase {
}
std::unique_ptr<views::Widget> widget_;
CrosNetworkConfigTestHelper network_config_helper_;
network_config::CrosNetworkConfigTestHelper network_config_helper_;
base::test::ScopedFeatureList feature_list_;
FakeNetworkListNetworkHeaderViewDelegate
fake_network_list_network_header_delegate_;

@ -26,21 +26,19 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/image_view.h"
using chromeos::network_config::IsInhibited;
using chromeos::network_config::mojom::DeviceStateProperties;
using chromeos::network_config::mojom::DeviceStateType;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::GlobalPolicy;
using chromeos::network_config::mojom::NetworkFilter;
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
namespace ash {
namespace {
using ::chromeos::network_config::IsInhibited;
using ::chromeos::network_config::mojom::DeviceStateProperties;
using ::chromeos::network_config::mojom::DeviceStateType;
using ::chromeos::network_config::mojom::FilterType;
using ::chromeos::network_config::mojom::GlobalPolicy;
using ::chromeos::network_config::mojom::NetworkFilter;
using ::chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using ::chromeos::network_config::mojom::NetworkType;
const int64_t kBluetoothTimeoutDelaySeconds = 2;
bool IsCellularDeviceInhibited() {
@ -474,7 +472,7 @@ void WifiSectionHeaderView::UpdateJoinButtonVisibility() {
}
const DeviceStateProperties* wifi_device =
model()->GetDevice(chromeos::network_config::mojom::NetworkType::kWiFi);
model()->GetDevice(NetworkType::kWiFi);
if (!wifi_device) {
join_button_->SetVisible(/*visible=*/false);
return;

@ -20,18 +20,18 @@
#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
using chromeos::network_config::mojom::ConnectionStateType;
namespace ash {
namespace {
using chromeos::network_config::mojom::DeviceStateProperties;
using chromeos::network_config::mojom::DeviceStatePropertiesPtr;
using chromeos::network_config::mojom::DeviceStateType;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
namespace {
const int kUpdateFrequencyMs = 1000;
NetworkStatePropertiesPtr GetConnectingOrConnected(
@ -50,8 +50,6 @@ NetworkStatePropertiesPtr GetConnectingOrConnected(
} // namespace
namespace ash {
class TrayNetworkStateModel::Impl
: public chromeos::network_config::CrosNetworkConfigObserver {
public:
@ -199,9 +197,8 @@ void TrayNetworkStateModel::SetNetworkTypeEnabledState(NetworkType type,
}
bool TrayNetworkStateModel::IsBuiltinVpnProhibited() const {
return TrayNetworkStateModel::GetDeviceState(
chromeos::network_config::mojom::NetworkType::kVPN) ==
chromeos::network_config::mojom::DeviceStateType::kProhibited;
return TrayNetworkStateModel::GetDeviceState(NetworkType::kVPN) ==
DeviceStateType::kProhibited;
}
chromeos::network_config::mojom::CrosNetworkConfig*

@ -15,10 +15,11 @@
#include "ash/system/unified/unified_system_tray_bubble.h"
#include "ash/test/ash_test_base.h"
#include "base/test/scoped_feature_list.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
namespace ash {
namespace {
using ::chromeos::network_config::mojom::ConnectionStateType;

@ -57,6 +57,10 @@
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
namespace ash {
namespace {
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
@ -68,9 +72,6 @@ using chromeos::network_config::mojom::VpnProviderPtr;
using chromeos::network_config::mojom::VPNStatePropertiesPtr;
using chromeos::network_config::mojom::VpnType;
namespace ash {
namespace {
// Layout constants for QsRevamp.
constexpr auto kQsContainerShortMargin = gfx::Insets::TLBR(0, 0, 2, 0);
constexpr auto kQsContainerTallMargin = gfx::Insets::TLBR(0, 0, 8, 0);

@ -12,7 +12,7 @@
#include "base/run_loop.h"
#include "chromeos/ash/components/dbus/shill/shill_clients.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "components/prefs/testing_pref_service.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/message_center/message_center.h"
@ -42,7 +42,7 @@ class WifiToggleNotificationControllerTest : public AshTestBase {
}
private:
chromeos::network_config::CrosNetworkConfigTestHelper network_config_helper_;
network_config::CrosNetworkConfigTestHelper network_config_helper_;
TestingPrefServiceSimple profile_prefs_;
TestingPrefServiceSimple local_state_;
};

@ -22,7 +22,7 @@
#include "base/test/metrics/histogram_tester.h"
#include "chromeos/ash/components/audio/cras_audio_handler.h"
#include "chromeos/ash/components/dbus/shill/shill_clients.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "components/prefs/testing_pref_service.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/animation/slide_animation.h"
@ -55,8 +55,8 @@ class UnifiedSystemTrayControllerTest : public AshTestBase,
// testing::Test:
void SetUp() override {
network_config_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
network_config_helper_ =
std::make_unique<network_config::CrosNetworkConfigTestHelper>();
AshTestBase::SetUp();
// Networking stubs may have asynchronous initialization.
base::RunLoop().RunUntilIdle();
@ -133,7 +133,7 @@ class UnifiedSystemTrayControllerTest : public AshTestBase,
}
private:
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<network_config::CrosNetworkConfigTestHelper>
network_config_helper_;
scoped_refptr<UnifiedSystemTrayModel> model_;
std::unique_ptr<UnifiedSystemTrayController> controller_;

@ -1,6 +1,6 @@
include_rules = [
"+chromeos/ash/components/login/login_state",
"+chromeos/services/network_config",
"+chromeos/ash/services/network_config",
"+chromeos/strings/grit/chromeos_strings.h",
"+components",
"+ui/base",

@ -55,9 +55,9 @@ static_library("backend") {
"//chromeos/ash/components/system",
"//chromeos/ash/services/cros_healthd/public/cpp",
"//chromeos/ash/services/cros_healthd/public/mojom",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/dbus/power",
"//chromeos/dbus/power:power_manager_proto",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config/public/cpp",
"//chromeos/strings/",
"//content/public/browser",
@ -114,12 +114,10 @@ source_set("unit_tests") {
"//chromeos/ash/components/system",
"//chromeos/ash/services/cros_healthd/public/cpp",
"//chromeos/ash/services/cros_healthd/public/mojom",
"//chromeos/ash/services/network_config",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/dbus/power",
"//chromeos/dbus/power:power_manager_proto",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config:network_config",
"//chromeos/services/network_config/public/cpp:test_support",
"//chromeos/services/network_config/public/mojom",
"//components/onc",
"//components/prefs:test_support",
"//components/sync_preferences:test_support",

@ -13,12 +13,13 @@
#include "base/containers/fixed_flat_map.h"
#include "base/functional/bind.h"
#include "base/strings/string_util.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "mojo/public/cpp/bindings/enum_traits.h"
namespace ash {
namespace diagnostics {
namespace {
namespace network_mojom = ::chromeos::network_config::mojom;
@ -541,7 +542,7 @@ void NetworkHealthProvider::OnDeviceStateListReceived(
}
std::string NetworkHealthProvider::AddNewNetwork(
const chromeos::network_config::mojom::DeviceStatePropertiesPtr& device) {
const network_mojom::DeviceStatePropertiesPtr& device) {
std::string observer_guid = base::GenerateGUID();
auto network = mojom::Network::New();
network->observer_guid = observer_guid;

@ -20,12 +20,13 @@
#include "chromeos/ash/components/network/network_device_handler.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_handler_test_helper.h"
#include "chromeos/ash/components/network/network_profile_handler.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_type_pattern.h"
#include "chromeos/ash/components/network/onc/network_onc_utils.h"
#include "chromeos/ash/components/network/system_token_cert_db_storage.h"
#include "chromeos/services/network_config/cros_network_config.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/cros_network_config.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-shared.h"
#include "components/onc/onc_constants.h"
@ -40,6 +41,7 @@
namespace ash {
namespace diagnostics {
namespace {
constexpr char kEth0DevicePath[] = "/device/eth0";
@ -59,9 +61,6 @@ constexpr char kNetworkDataError[] = "ChromeOS.DiagnosticsUi.Error.Network";
// expectation_not_met_error will be triggered 4 times for every change.
constexpr int kExpectationNotMetErrorCount = 4;
// TODO(https://crbug.com/1164001): remove when network_config is moved to ash.
namespace network_config = ::chromeos::network_config;
class FakeNetworkListObserver : public mojom::NetworkListObserver {
public:
void OnNetworkListChanged(const std::vector<std::string>& observer_guids,

@ -33,8 +33,7 @@ mojom("mojom") {
]
traits_headers = [ "network_provider_mojom_traits.h" ]
traits_sources = [ "network_provider_mojom_traits.cc" ]
traits_public_deps =
[ "//chromeos/services/network_config/public/mojom:mojom" ]
traits_public_deps = [ "//chromeos/services/network_config/public/mojom" ]
},
]
}
@ -46,7 +45,7 @@ source_set("unit_tests") {
":mojom",
"//base",
"//base/test:test_support",
"//chromeos/services/network_config/public/mojom:mojom",
"//chromeos/services/network_config/public/mojom",
"//mojo/public/cpp/test_support:test_utils",
"//services/data_decoder/public/cpp:test_support",
"//services/device/public/cpp:test_support",

@ -19,6 +19,9 @@
namespace ash {
namespace eche_app {
namespace network_config = ::chromeos::network_config;
using network_config::mojom::ConnectionStateType;
const char kJsonDeviceNameKey[] = "device_name";
const char kJsonBoardNameKey[] = "board_name";
const char kJsonTabletModeKey[] = "tablet_mode";
@ -31,10 +34,6 @@ const char kJsonSendStartSignalingKey[] = "send_start_signaling";
const char kJsonDisableStunServerKey[] = "disable_stun_server";
const char kJsonCheckAndroidNetworkInfoKey[] = "check_android_network_info";
using chromeos::network_config::mojom::ConnectionStateType;
// TODO(https://crbug.com/1164001): remove when it moved to ash.
namespace network_config = ::chromeos::network_config;
const std::map<ConnectionStateType, const char*> CONNECTION_STATE_TYPE{
{ConnectionStateType::kOnline, "online"},
{ConnectionStateType::kConnected, "connected"},
@ -178,7 +177,7 @@ void SystemInfoProvider::OnTabletModeEnded() {
// network_config::mojom::CrosNetworkConfigObserver implementation:
void SystemInfoProvider::OnNetworkStateChanged(
chromeos::network_config::mojom::NetworkStatePropertiesPtr network) {
network_config::mojom::NetworkStatePropertiesPtr network) {
PA_LOG(INFO) << "echeapi SystemInfoProvider OnNetworkStateChanged";
FetchWifiNetworkList();
}
@ -220,7 +219,7 @@ void SystemInfoProvider::FetchWifiNetworkList() {
void SystemInfoProvider::OnWifiNetworkList(
std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks) {
using chromeos::network_config::mojom::NetworkType;
using network_config::mojom::NetworkType;
for (const auto& network : networks) {
if (network->type == NetworkType::kWiFi) {

@ -16,9 +16,8 @@
namespace ash {
namespace eche_app {
using chromeos::network_config::mojom::ConnectionStateType;
// TODO(https://crbug.com/1164001): remove when it moved to ash.
namespace network_config = ::chromeos::network_config;
using network_config::mojom::ConnectionStateType;
const char kFakeDeviceName[] = "Guanru's Chromebook";
const char kFakeBoardName[] = "atlas";
@ -271,9 +270,8 @@ class SystemInfoProviderTest : public testing::Test {
std::vector<network_config::mojom::NetworkStatePropertiesPtr>
GetWifiNetworkStateList() {
std::vector<network_config::mojom::NetworkStatePropertiesPtr> result;
auto network =
::chromeos::network_config::mojom::NetworkStateProperties::New();
network->type = chromeos::network_config::mojom::NetworkType::kWiFi;
auto network = network_config::mojom::NetworkStateProperties::New();
network->type = network_config::mojom::NetworkType::kWiFi;
network->connection_state = kFakeWifiConnectionState;
result.emplace_back(std::move(network));
return result;
@ -293,7 +291,7 @@ class SystemInfoProviderTest : public testing::Test {
private:
// base::test::TaskEnvironment task_environment_;
std::unique_ptr<SystemInfoProvider> system_info_provider_;
mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig>
mojo::Remote<network_config::mojom::CrosNetworkConfig>
remote_cros_network_config_;
};

@ -4,7 +4,7 @@ include_rules = [
"+chromeos/ash/components/dbus/rmad",
"+chromeos/ash/components/dbus/update_engine",
"+chromeos/ash/components/login/login_state",
"+chromeos/services/network_config",
"+chromeos/ash/services/network_config",
"+chromeos/version",
"+ui/resources",
"+ui/web_dialogs",

@ -24,9 +24,9 @@ static_library("backend") {
"//chromeos/ash/components/dbus/update_engine",
"//chromeos/ash/components/dbus/update_engine:proto",
"//chromeos/ash/components/network",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/dbus/power",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config/public/mojom:mojom",
"//chromeos/services/network_config/public/mojom",
"//chromeos/version",
"//components/qr_code_generator",
]
@ -53,9 +53,9 @@ source_set("unit_tests") {
"//chromeos/ash/components/login/login_state:login_state",
"//chromeos/ash/components/network",
"//chromeos/ash/components/network:test_support",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//chromeos/dbus/power",
"//chromeos/services/network_config/public/cpp:test_support",
"//chromeos/services/network_config/public/mojom:mojom",
"//chromeos/services/network_config/public/mojom",
"//chromeos/services/network_config/public/mojom:network_types_shared_cpp_sources",
"//components/onc:onc",
"//components/prefs:test_support",

@ -26,18 +26,12 @@
#include "chromeos/ash/components/network/network_state.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_type_pattern.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/dbus/power/power_manager_client.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "chromeos/version/version_loader.h"
#include "third_party/skia/include/core/SkBitmap.h"
using chromeos::network_config::mojom::ConnectionStateType;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
namespace ash {
namespace shimless_rma {
@ -64,7 +58,7 @@ bool HaveAllowedNetworkConnection() {
return network && network->IsConnectedState() && !metered;
}
chromeos::network_config::mojom::NetworkFilterPtr GetConfiguredWiFiFilter() {
network_mojom::NetworkFilterPtr GetConfiguredWiFiFilter() {
return network_mojom::NetworkFilter::New(
network_mojom::FilterType::kConfigured, network_mojom::NetworkType::kWiFi,
network_mojom::kNoLimit);
@ -273,8 +267,7 @@ void ShimlessRmaService::ForgetNewNetworkConnections(
}
void ShimlessRmaService::OnForgetNewNetworkConnections(
std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr>
networks) {
std::vector<network_mojom::NetworkStatePropertiesPtr> networks) {
DCHECK(existing_saved_network_guids_.has_value());
DCHECK(pending_network_guids_to_forget_.empty());

@ -30,8 +30,8 @@
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/ash/components/network/network_type_pattern.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/dbus/power/fake_power_manager_client.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"

@ -22,7 +22,7 @@
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/ash/components/network/onc/network_onc_utils.h"
#include "chromeos/ash/components/network/proxy/ui_proxy_config_service.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-shared.h"
#include "components/onc/onc_constants.h"

@ -9,7 +9,7 @@
#include "ash/webui/shimless_rma/backend/shimless_rma_service.h"
#include "ash/webui/shimless_rma/mojom/shimless_rma.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h" // nogncheck
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "ui/web_dialogs/web_dialog_ui.h"

@ -5124,6 +5124,8 @@ static_library("browser") {
"//chromeos/ash/services/nearby/public/cpp:tcp_server_socket_port",
"//chromeos/ash/services/nearby/public/mojom",
"//chromeos/ash/services/nearby/public/mojom:nearby_share_settings",
"//chromeos/ash/services/network_config",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/ash/services/network_health/public/cpp",
"//chromeos/ash/services/secure_channel/public/mojom",
"//chromeos/components/onc",
@ -5134,8 +5136,6 @@ static_library("browser") {
"//chromeos/crosapi/mojom",
"//chromeos/dbus/tpm_manager",
"//chromeos/dbus/tpm_manager:tpm_manager_proto",
"//chromeos/services/network_config",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config/public/mojom",
"//chromeos/services/network_health/public/mojom",
"//chromeos/strings",

@ -3819,6 +3819,8 @@ source_set("ash") {
"//chromeos/ash/services/multidevice_setup/public/cpp:oobe_completion_tracker",
"//chromeos/ash/services/multidevice_setup/public/cpp:prefs",
"//chromeos/ash/services/multidevice_setup/public/mojom",
"//chromeos/ash/services/network_config",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/ash/services/network_health:in_process_instance",
"//chromeos/ash/services/quick_pair/public/mojom",
"//chromeos/ash/services/secure_channel",
@ -3841,7 +3843,6 @@ source_set("ash") {
"//chromeos/dbus/u2f",
"//chromeos/ime:gencode",
"//chromeos/services/machine_learning/public/cpp",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/strings",
"//chromeos/ui/frame",
"//chromeos/ui/vector_icons",
@ -5526,6 +5527,9 @@ source_set("unit_tests") {
"//chromeos/ash/services/multidevice_setup/public/cpp:test_support",
"//chromeos/ash/services/nearby/public/cpp:test_support",
"//chromeos/ash/services/nearby/public/mojom",
"//chromeos/ash/services/network_config",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//chromeos/ash/services/secure_channel/public/cpp/client",
"//chromeos/ash/services/secure_channel/public/cpp/client:test_support",
"//chromeos/ash/services/secure_channel/public/mojom",
@ -5550,8 +5554,6 @@ source_set("unit_tests") {
"//chromeos/services/machine_learning/public/cpp",
"//chromeos/services/machine_learning/public/cpp:stub",
"//chromeos/services/machine_learning/public/mojom",
"//chromeos/services/network_config",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config/public/cpp:test_support",
"//chromeos/services/network_config/public/mojom",
"//chromeos/services/network_health/public/mojom",

@ -31,7 +31,7 @@
#include "chrome/test/base/testing_profile.h"
#include "chromeos/ash/components/dbus/concierge/concierge_client.h"
#include "chromeos/ash/components/network/network_handler_test_helper.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "components/arc/test/fake_intent_helper_host.h"
#include "components/arc/test/fake_intent_helper_instance.h"
#include "components/prefs/pref_service.h"
@ -62,8 +62,8 @@ class ArcSettingsServiceTest : public BrowserWithTestWindowTest {
ash::ConciergeClient::InitializeFake(/*fake_cicerone_client=*/nullptr);
network_handler_test_helper_ =
std::make_unique<ash::NetworkHandlerTestHelper>();
network_config_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
network_config_helper_ =
std::make_unique<ash::network_config::CrosNetworkConfigTestHelper>();
ash::StatsReportingController::RegisterLocalStatePrefs(
local_state_.registry());
ash::StatsReportingController::Initialize(&local_state_);
@ -155,7 +155,7 @@ class ArcSettingsServiceTest : public BrowserWithTestWindowTest {
private:
std::unique_ptr<ash::NetworkHandlerTestHelper> network_handler_test_helper_;
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<ash::network_config::CrosNetworkConfigTestHelper>
network_config_helper_;
TestingPrefServiceSimple local_state_;
user_manager::ScopedUserManager user_manager_enabler_;

@ -7,8 +7,8 @@
#include "base/test/bind.h"
#include "base/test/test_future.h"
#include "chrome/browser/ash/crosapi/ash_requires_lacros_browsertestbase.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_observer.h"
#include "chromeos/crosapi/mojom/test_controller.mojom-test-utils.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_observer.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "content/public/test/browser_test.h"
@ -34,7 +34,7 @@ class VpnExtensionObserverBrowserTest
};
class ExtensionEventWaiter
: public cros_network::CrosNetworkConfigTestObserver {
: public ash::network_config::CrosNetworkConfigTestObserver {
public:
using VpnProviders = std::vector<cros_network::mojom::VpnProviderPtr>;

@ -62,7 +62,7 @@ class VpnProvidersObserver
explicit VpnProvidersObserver(Delegate*);
~VpnProvidersObserver() override;
// chromeos::network_config::CrosNetworkConfigObserver:
// ash::network_config::CrosNetworkConfigObserver:
void OnVpnProvidersChanged() override;
private:

@ -35,7 +35,7 @@
#include "chromeos/ash/services/nearby/public/mojom/sharing.mojom.h"
#include "chromeos/ash/services/nearby/public/mojom/tcp_socket_factory.mojom.h"
#include "chromeos/ash/services/nearby/public/mojom/webrtc.mojom.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/account_id/account_id.h"
#include "components/prefs/pref_service.h"
@ -154,7 +154,7 @@ class NearbyProcessManagerImplTest : public testing::Test {
int prepare_for_shutdown_count() { return prepare_for_shutdown_count_; }
private:
chromeos::network_config::CrosNetworkConfigTestHelper
network_config::CrosNetworkConfigTestHelper
cros_network_config_test_helper_;
std::unique_ptr<bluetooth::FakeAdapter> fake_adapter_;
std::unique_ptr<sharing::MockWebRtcDependencies> webrtc_dependencies_;

@ -19,6 +19,7 @@
namespace ash {
namespace {
void OnSetShillUserApnListSuccess() {}
void OnSetShillUserApnListFailure(const std::string& guid,
@ -27,6 +28,7 @@ void OnSetShillUserApnListFailure(const std::string& guid,
"list in Shill for network: "
<< guid << ": [" << error_name << ']';
}
} // namespace
ApnMigrator::ApnMigrator(

@ -21,7 +21,7 @@
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/ash/components/network/network_type_pattern.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "chromeos/services/network_config/public/cpp/fake_cros_network_config.h"
#include "components/onc/onc_constants.h"
@ -30,17 +30,18 @@
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
namespace ash {
namespace {
using ::chromeos::network_config::FakeCrosNetworkConfig;
using ::chromeos::network_config::OverrideInProcessInstanceForTesting;
using network_config::OverrideInProcessInstanceForTesting;
using ::testing::_;
using ::testing::Eq;
using ::testing::Invoke;
using ::testing::Return;
using ::testing::SaveArg;
using ::testing::Truly;
using ::testing::WithArg;
namespace {
constexpr char kCellularName1[] = "cellular_device_1";
constexpr char kTestCellularPath1[] = "/device/cellular_device_1";
constexpr char kTestCellularIccid1[] = "test_iccid_1";
@ -61,6 +62,7 @@ constexpr char kCellularServicePattern[] =
"Strength": 0, "Cellular.NetworkTechnology": "LTE",
"Cellular.ActivationState": "activated", "Cellular.ICCID": "%s",
"Profile": "%s"})";
} // namespace
class ApnMigratorTest : public testing::Test {
@ -162,7 +164,7 @@ class ApnMigratorTest : public testing::Test {
TEST_F(ApnMigratorTest, ApnRevampFlagDisabled) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(ash::features::kApnRevamp);
scoped_feature_list.InitAndDisableFeature(features::kApnRevamp);
const std::string cellular_service_path_1 =
AddTestCellularDeviceAndService(kCellularName1, kTestCellularPath1,
@ -209,7 +211,7 @@ TEST_F(ApnMigratorTest, ApnRevampFlagDisabled) {
TEST_F(ApnMigratorTest, ApnRevampFlagEnabled_AlreadyMigratedNetworks) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(ash::features::kApnRevamp);
scoped_feature_list.InitAndEnableFeature(features::kApnRevamp);
const std::string cellular_service_path_1 =
AddTestCellularDeviceAndService(kCellularName1, kTestCellularPath1,
@ -302,7 +304,7 @@ TEST_F(ApnMigratorTest, ApnRevampFlagEnabled_AlreadyMigratedNetworks) {
TEST_F(ApnMigratorTest, ApnRevampFlagEnabled_MigrateNetworksWithoutCustomApns) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(ash::features::kApnRevamp);
scoped_feature_list.InitAndEnableFeature(features::kApnRevamp);
const std::string cellular_service_path_1 =
AddTestCellularDeviceAndService(kCellularName1, kTestCellularPath1,
@ -364,7 +366,7 @@ TEST_F(ApnMigratorTest, ApnRevampFlagEnabled_MigrateNetworksWithoutCustomApns) {
TEST_F(ApnMigratorTest, ApnRevampFlagEnabled_MigrateNetwork) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(ash::features::kApnRevamp);
scoped_feature_list.InitAndEnableFeature(features::kApnRevamp);
const std::string cellular_service_path_1 =
AddTestCellularDeviceAndService(kCellularName1, kTestCellularPath1,

@ -11,7 +11,7 @@
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/ash/net/network_diagnostics/arc_ping_routine.h"
#include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
namespace ash {
@ -20,10 +20,6 @@ namespace network_diagnostics {
namespace {
namespace mojom = ::chromeos::network_diagnostics::mojom;
// TODO(https://crbug.com/1164001): remove when migrated to namespace ash.
namespace network_config = ::chromeos::network_config;
using ::chromeos::network_config::mojom::CrosNetworkConfig;
using ::chromeos::network_config::mojom::FilterType;
using ::chromeos::network_config::mojom::ManagedPropertiesPtr;
@ -33,7 +29,7 @@ using ::chromeos::network_config::mojom::NetworkType;
void GetNetworkConfigService(
mojo::PendingReceiver<CrosNetworkConfig> receiver) {
chromeos::network_config::BindToInProcessInstance(std::move(receiver));
network_config::BindToInProcessInstance(std::move(receiver));
}
// Requests taking longer than 1500 ms are problematic.
@ -101,7 +97,7 @@ void ArcPingRoutine::FetchActiveNetworks() {
DCHECK(remote_cros_network_config_);
remote_cros_network_config_->GetNetworkStateList(
NetworkFilter::New(FilterType::kActive, NetworkType::kAll,
network_config::mojom::kNoLimit),
chromeos::network_config::mojom::kNoLimit),
base::BindOnce(&ArcPingRoutine::OnNetworkStateListReceived,
weak_ptr_factory_.GetWeakPtr()));
}
@ -143,7 +139,8 @@ void ArcPingRoutine::OnNetworkStateListReceived(
bool connected = false;
std::vector<std::string> guids;
for (const auto& network : networks) {
if (!network_config::StateIsConnected(network->connection_state)) {
if (!chromeos::network_config::StateIsConnected(
network->connection_state)) {
continue;
}
connected = true;

@ -7,7 +7,7 @@
#include <utility>
#include "base/functional/bind.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
namespace ash {
@ -16,9 +16,8 @@ namespace network_diagnostics {
namespace {
namespace mojom = ::chromeos::network_diagnostics::mojom;
// TODO(https://crbug.com/1164001): remove when migrated to namespace ash.
namespace network_config = ::chromeos::network_config;
using ::ash::network_config::BindToInProcessInstance;
mojom::CaptivePortalProblem GetProblemFromPortalState(
network_config::mojom::PortalState portal_state) {
@ -44,7 +43,7 @@ mojom::CaptivePortalProblem GetProblemFromPortalState(
} // namespace
CaptivePortalRoutine::CaptivePortalRoutine() {
network_config::BindToInProcessInstance(
BindToInProcessInstance(
remote_cros_network_config_.BindNewPipeAndPassReceiver());
}

@ -9,7 +9,7 @@
#include <vector>
#include "base/functional/bind.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "components/onc/onc_constants.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
@ -19,13 +19,11 @@
namespace ash {
namespace network_diagnostics {
namespace {
namespace mojom = ::chromeos::network_diagnostics::mojom;
// TODO(https://crbug.com/1164001): remove when migrated to namespace ash.
namespace network_config = ::chromeos::network_config;
// Filters the list of |name_servers| and returns those that are not
// empty/default values.
std::vector<std::string> GetNonEmptyNameServers(
@ -45,7 +43,7 @@ std::vector<std::string> GetNonEmptyNameServers(
// config type. If the type is not set, IPv4 is assumed.
bool NameServersHaveValidAddresses(
const std::vector<std::string>& name_servers,
::chromeos::network_config::mojom::IPConfigType type) {
chromeos::network_config::mojom::IPConfigType type) {
for (const auto& name_server : name_servers) {
net::IPAddress ip_address;
if (!ip_address.AssignFromIPLiteral(name_server)) {
@ -53,11 +51,11 @@ bool NameServersHaveValidAddresses(
}
switch (type) {
case ::chromeos::network_config::mojom::IPConfigType::kIPv4:
case chromeos::network_config::mojom::IPConfigType::kIPv4:
if (ip_address.IsIPv4())
return true;
break;
case ::chromeos::network_config::mojom::IPConfigType::kIPv6:
case chromeos::network_config::mojom::IPConfigType::kIPv6:
if (ip_address.IsIPv6() || ip_address.IsIPv4MappedIPv6())
return true;
break;
@ -114,10 +112,10 @@ void DnsResolverPresentRoutine::AnalyzeResultsAndExecuteCallback() {
void DnsResolverPresentRoutine::FetchActiveNetworks() {
DCHECK(remote_cros_network_config_);
remote_cros_network_config_->GetNetworkStateList(
network_config::mojom::NetworkFilter::New(
network_config::mojom::FilterType::kActive,
network_config::mojom::NetworkType::kAll,
network_config::mojom::kNoLimit),
chromeos::network_config::mojom::NetworkFilter::New(
chromeos::network_config::mojom::FilterType::kActive,
chromeos::network_config::mojom::NetworkType::kAll,
chromeos::network_config::mojom::kNoLimit),
base::BindOnce(&DnsResolverPresentRoutine::OnNetworkStateListReceived,
base::Unretained(this)));
}
@ -131,7 +129,7 @@ void DnsResolverPresentRoutine::FetchManagedProperties(
}
void DnsResolverPresentRoutine::OnManagedPropertiesReceived(
network_config::mojom::ManagedPropertiesPtr managed_properties) {
chromeos::network_config::mojom::ManagedPropertiesPtr managed_properties) {
if (!managed_properties || !managed_properties->ip_configs.has_value()) {
AnalyzeResultsAndExecuteCallback();
return;
@ -160,10 +158,11 @@ void DnsResolverPresentRoutine::OnManagedPropertiesReceived(
// Process the network interface information.
void DnsResolverPresentRoutine::OnNetworkStateListReceived(
std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks) {
std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr>
networks) {
std::string default_guid;
for (const auto& network : networks) {
if (network_config::StateIsConnected(network->connection_state)) {
if (chromeos::network_config::StateIsConnected(network->connection_state)) {
default_guid = network->guid;
break;
}

@ -10,7 +10,7 @@
#include "base/json/json_reader.h"
#include "base/values.h"
#include "chromeos/ash/components/dbus/debug_daemon/debug_daemon_client.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
@ -23,10 +23,6 @@ namespace network_diagnostics {
namespace {
namespace mojom = ::chromeos::network_diagnostics::mojom;
// TODO(https://crbug.com/1164001): remove when migrated to namespace ash.
namespace network_config = ::chromeos::network_config;
using chromeos::network_config::mojom::CrosNetworkConfig;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::ManagedPropertiesPtr;
@ -36,7 +32,7 @@ using chromeos::network_config::mojom::NetworkType;
void GetNetworkConfigService(
mojo::PendingReceiver<CrosNetworkConfig> receiver) {
chromeos::network_config::BindToInProcessInstance(std::move(receiver));
network_config::BindToInProcessInstance(std::move(receiver));
}
// The maximum latency threshold (in milliseconds) for pinging the gateway.
@ -110,7 +106,7 @@ void GatewayCanBePingedRoutine::FetchActiveNetworks() {
DCHECK(remote_cros_network_config_);
remote_cros_network_config_->GetNetworkStateList(
NetworkFilter::New(FilterType::kActive, NetworkType::kAll,
network_config::mojom::kNoLimit),
chromeos::network_config::mojom::kNoLimit),
base::BindOnce(&GatewayCanBePingedRoutine::OnNetworkStateListReceived,
base::Unretained(this)));
}
@ -176,7 +172,8 @@ void GatewayCanBePingedRoutine::OnNetworkStateListReceived(
bool connected = false;
std::vector<std::string> guids;
for (const auto& network : networks) {
if (!network_config::StateIsConnected(network->connection_state)) {
if (!chromeos::network_config::StateIsConnected(
network->connection_state)) {
continue;
}
connected = true;

@ -9,7 +9,7 @@
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
@ -21,10 +21,6 @@ namespace network_diagnostics {
namespace {
namespace mojom = ::chromeos::network_diagnostics::mojom;
// TODO(https://crbug.com/1164001): remove when migrated to namespace ash.
namespace network_config = ::chromeos::network_config;
using chromeos::network_config::mojom::CrosNetworkConfig;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
@ -34,7 +30,7 @@ using chromeos::network_config::mojom::SecurityType;
void GetNetworkConfigService(
mojo::PendingReceiver<CrosNetworkConfig> receiver) {
chromeos::network_config::BindToInProcessInstance(std::move(receiver));
network_config::BindToInProcessInstance(std::move(receiver));
}
constexpr SecurityType kSecureWiFiEncryptions[] = {SecurityType::kWpaEap,
@ -104,7 +100,7 @@ void HasSecureWiFiConnectionRoutine::FetchActiveWiFiNetworks() {
DCHECK(remote_cros_network_config_);
remote_cros_network_config_->GetNetworkStateList(
NetworkFilter::New(FilterType::kActive, NetworkType::kWiFi,
network_config::mojom::kNoLimit),
chromeos::network_config::mojom::kNoLimit),
base::BindOnce(
&HasSecureWiFiConnectionRoutine::OnNetworkStateListReceived,
base::Unretained(this)));
@ -114,7 +110,7 @@ void HasSecureWiFiConnectionRoutine::FetchActiveWiFiNetworks() {
void HasSecureWiFiConnectionRoutine::OnNetworkStateListReceived(
std::vector<NetworkStatePropertiesPtr> networks) {
for (const NetworkStatePropertiesPtr& network : networks) {
if (network_config::StateIsConnected(network->connection_state)) {
if (chromeos::network_config::StateIsConnected(network->connection_state)) {
wifi_connected_ = true;
wifi_security_ = network->type_state->get_wifi()->security;
break;

@ -4,7 +4,7 @@
#include "chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"

@ -7,7 +7,7 @@
#include <utility>
#include "base/functional/bind.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
@ -19,10 +19,6 @@ namespace network_diagnostics {
namespace {
namespace mojom = ::chromeos::network_diagnostics::mojom;
// TODO(https://crbug.com/1164001): remove when migrated to namespace ash.
namespace network_config = ::chromeos::network_config;
using chromeos::network_config::mojom::CrosNetworkConfig;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
@ -31,7 +27,7 @@ using chromeos::network_config::mojom::NetworkType;
void GetNetworkConfigService(
mojo::PendingReceiver<CrosNetworkConfig> receiver) {
chromeos::network_config::BindToInProcessInstance(std::move(receiver));
network_config::BindToInProcessInstance(std::move(receiver));
}
} // namespace
@ -74,7 +70,7 @@ void LanConnectivityRoutine::FetchActiveNetworks() {
// |remote_cros_network_config_| is a mojo::Remote owned by |this|.
remote_cros_network_config_->GetNetworkStateList(
NetworkFilter::New(FilterType::kActive, NetworkType::kAll,
network_config::mojom::kNoLimit),
chromeos::network_config::mojom::kNoLimit),
base::BindOnce(&LanConnectivityRoutine::OnNetworkStateListReceived,
base::Unretained(this)));
}
@ -83,7 +79,7 @@ void LanConnectivityRoutine::FetchActiveNetworks() {
void LanConnectivityRoutine::OnNetworkStateListReceived(
std::vector<NetworkStatePropertiesPtr> networks) {
for (const NetworkStatePropertiesPtr& network : networks) {
if (network_config::StateIsConnected(network->connection_state)) {
if (chromeos::network_config::StateIsConnected(network->connection_state)) {
lan_connected_ = true;
break;
}

@ -5,7 +5,7 @@
#include "chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.h"
#include "base/memory/weak_ptr.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"

@ -3,19 +3,15 @@
// found in the LICENSE file.
#include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_test_helper.h"
#include "base/values.h"
#include "chromeos/ash/components/network/network_profile_handler.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
namespace ash {
namespace network_diagnostics {
namespace {
// TODO(https://crbug.com/1164001): remove when network_config is moved to ash.
namespace network_config = ::chromeos::network_config;
} // namespace
NetworkDiagnosticsTestHelper::NetworkDiagnosticsTestHelper()
: task_environment_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) {
LoginState::Initialize();

@ -11,8 +11,7 @@
#include "chromeos/ash/components/network/managed_network_configuration_handler.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_handler_test_helper.h"
#include "chromeos/services/network_config/cros_network_config.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/cros_network_config.h"
#include "components/prefs/testing_pref_service.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
@ -46,8 +45,7 @@ class NetworkDiagnosticsTestHelper : public ::testing::Test {
// are dependent on them.
base::test::TaskEnvironment task_environment_;
std::unique_ptr<NetworkHandlerTestHelper> helper_;
std::unique_ptr<::chromeos::network_config::CrosNetworkConfig>
cros_network_config_;
std::unique_ptr<network_config::CrosNetworkConfig> cros_network_config_;
sync_preferences::TestingPrefServiceSyncable user_prefs_;
TestingPrefServiceSimple local_state_;
std::string wifi_path_;

@ -8,7 +8,7 @@
#include <utility>
#include "base/functional/bind.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_util.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
@ -20,10 +20,6 @@ namespace network_diagnostics {
namespace {
namespace mojom = ::chromeos::network_diagnostics::mojom;
// TODO(https://crbug.com/1164001): remove when migrated to namespace ash.
namespace network_config = ::chromeos::network_config;
using chromeos::network_config::mojom::CrosNetworkConfig;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::NetworkFilter;
@ -32,7 +28,7 @@ using chromeos::network_config::mojom::NetworkType;
void GetNetworkConfigService(
mojo::PendingReceiver<CrosNetworkConfig> receiver) {
chromeos::network_config::BindToInProcessInstance(std::move(receiver));
network_config::BindToInProcessInstance(std::move(receiver));
}
// Represents the point below which the NIC signal strength is so
@ -82,7 +78,7 @@ void SignalStrengthRoutine::FetchActiveWirelessNetworks() {
// |remote_cros_network_config_| is a mojo::Remote owned by |this|.
remote_cros_network_config_->GetNetworkStateList(
NetworkFilter::New(FilterType::kActive, NetworkType::kWireless,
network_config::mojom::kNoLimit),
chromeos::network_config::mojom::kNoLimit),
base::BindOnce(&SignalStrengthRoutine::OnNetworkStateListReceived,
base::Unretained(this)));
}
@ -91,9 +87,9 @@ void SignalStrengthRoutine::FetchActiveWirelessNetworks() {
void SignalStrengthRoutine::OnNetworkStateListReceived(
std::vector<NetworkStatePropertiesPtr> networks) {
for (const NetworkStatePropertiesPtr& network : networks) {
if (network_config::StateIsConnected(network->connection_state)) {
if (chromeos::network_config::StateIsConnected(network->connection_state)) {
signal_strength_ =
network_config::GetWirelessSignalStrength(network.get());
chromeos::network_config::GetWirelessSignalStrength(network.get());
break;
}
}

@ -4,7 +4,7 @@
#include "chrome/browser/ash/net/network_diagnostics/signal_strength_routine.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"

@ -15,9 +15,10 @@
#include "chromeos/ash/components/network/network_configuration_handler.h"
#include "chromeos/ash/components/network/network_handler_test_helper.h"
#include "chromeos/ash/components/network/network_metadata_store.h"
#include "chromeos/services/network_config/cros_network_config.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/components/network/network_profile_handler.h"
#include "chromeos/ash/services/network_config/cros_network_config.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -29,9 +30,6 @@ namespace traffic_counters {
namespace {
// TODO(https://crbug.com/1164001): remove when network_config is moved to ash.
namespace network_config = ::chromeos::network_config;
class TrafficCountersHandlerTest : public ::testing::Test {
public:
TrafficCountersHandlerTest()

@ -31,7 +31,7 @@
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_policy_observer.h"
#include "chromeos/ash/components/system/fake_statistics_provider.h"
#include "chromeos/services/network_config/cros_network_config.h"
#include "chromeos/ash/services/network_config/cros_network_config.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/account_id/account_id.h"
#include "components/policy/core/browser/browser_policy_connector.h"
@ -52,18 +52,15 @@
namespace policy {
using ::testing::Contains;
namespace {
namespace network_mojom = ::chromeos::network_config::mojom;
using ::base::test::DictionaryHasValue;
using ::testing::ElementsAre;
using ::testing::IsEmpty;
using ::testing::Not;
using ::testing::SizeIs;
namespace network_mojom = ::chromeos::network_config::mojom;
namespace {
using ::base::test::DictionaryHasValue;
constexpr char kUserProfilePath[] = "user_profile";
constexpr char kSharedProfilePath[] = "/profile/default";
constexpr char kServiceEth[] = "/service/0";
@ -394,7 +391,7 @@ class NetworkPolicyApplicationTest : public ash::LoginManagerTest {
void CrosNetworkConfigSetProperties(
const std::string& guid,
network_mojom::ConfigPropertiesPtr properties) {
chromeos::network_config::CrosNetworkConfig cros_network_config;
ash::network_config::CrosNetworkConfig cros_network_config;
base::test::TestFuture<bool, std::string> set_properties_future;
cros_network_config.SetProperties(
@ -409,7 +406,7 @@ class NetworkPolicyApplicationTest : public ash::LoginManagerTest {
// using cros_network_config.
network_mojom::ManagedPropertiesPtr CrosNetworkConfigGetManagedProperties(
const std::string& guid) {
chromeos::network_config::CrosNetworkConfig cros_network_config;
ash::network_config::CrosNetworkConfig cros_network_config;
base::test::TestFuture<network_mojom::ManagedPropertiesPtr>
get_managed_properties_future;

@ -12,7 +12,7 @@
#include "chrome/browser/ash/app_mode/kiosk_app_manager.h"
#include "chrome/browser/ash/app_mode/web_app/web_kiosk_app_manager.h"
#include "chrome/browser/ash/policy/remote_commands/crd_logging.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "components/user_manager/user_manager.h"
#include "ui/base/user_activity/user_activity_detector.h"
@ -24,7 +24,6 @@ using chromeos::network_config::mojom::CrosNetworkConfig;
using chromeos::network_config::mojom::FilterType;
using chromeos::network_config::mojom::kNoLimit;
using chromeos::network_config::mojom::NetworkFilter;
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
using chromeos::network_config::mojom::OncSource;

@ -27,7 +27,7 @@
#include "chrome/browser/device_identity/device_oauth2_token_service_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chromeos/ash/components/cryptohome/system_salt_getter.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "extensions/common/value_builder.h"
@ -1111,7 +1111,7 @@ TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest,
TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest,
ShouldOnlyFetchTheActiveNetworks) {
MockCrosNetworkConfig network_config_mock;
chromeos::network_config::OverrideInProcessInstanceForTesting(
ash::network_config::OverrideInProcessInstanceForTesting(
&network_config_mock);
TestFuture<chromeos::network_config::mojom::NetworkFilterPtr,
@ -1130,8 +1130,7 @@ TEST_F(DeviceCommandStartCrdSessionJobRemoteAccessTest,
auto [filter, callback] = get_network_state_future.Take();
EXPECT_EQ(filter->filter,
chromeos::network_config::mojom::FilterType::kActive);
EXPECT_EQ(filter->network_type,
chromeos::network_config::mojom::NetworkType::kAll);
EXPECT_EQ(filter->network_type, NetworkType::kAll);
EXPECT_EQ(filter->limit, chromeos::network_config::mojom::kNoLimit);
// We must invoke the callback to satisfy the Mojom contract

@ -3,14 +3,14 @@
// found in the LICENSE file.
#include "chrome/browser/ash/policy/remote_commands/fake_cros_network_config.h"
#include "base/strings/stringprintf.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
namespace policy::test {
namespace {
using chromeos::network_config::mojom::NetworkStateProperties;
using chromeos::network_config::mojom::NetworkStatePropertiesPtr;
using chromeos::network_config::mojom::NetworkType;
using chromeos::network_config::mojom::NetworkTypeStateProperties;
@ -124,11 +124,11 @@ NetworkTypeStatePropertiesPtr NetworkBuilder::CreateTypeStateForType(
////////////////////////////////////////////////////////////////////////////////
ScopedFakeCrosNetworkConfig::ScopedFakeCrosNetworkConfig() {
chromeos::network_config::OverrideInProcessInstanceForTesting(this);
ash::network_config::OverrideInProcessInstanceForTesting(this);
}
ScopedFakeCrosNetworkConfig::~ScopedFakeCrosNetworkConfig() {
chromeos::network_config::OverrideInProcessInstanceForTesting(nullptr);
ash::network_config::OverrideInProcessInstanceForTesting(nullptr);
}
} // namespace policy::test

@ -32,8 +32,8 @@
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/printing/ppd_provider.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "components/prefs/pref_service.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/browser_task_environment.h"

@ -7,7 +7,7 @@
#include "chrome/browser/nearby_sharing/logging/logging.h"
#include "chrome/browser/nearby_sharing/nearby_share_metrics_logger.h"
#include "chromeos/ash/components/network/network_configuration_handler.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
namespace {
@ -27,7 +27,7 @@ chromeos::network_config::mojom::SecurityType MojoSecurityTypeFromAttachment(
} // namespace
WifiNetworkConfigurationHandler::WifiNetworkConfigurationHandler() {
chromeos::network_config::BindToInProcessInstance(
ash::network_config::BindToInProcessInstance(
cros_network_config_remote_.BindNewPipeAndPassReceiver());
}

@ -9,8 +9,8 @@
#include "chrome/browser/nearby_sharing/wifi_credentials_attachment.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/services/network_config/cros_network_config.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/cros_network_config.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@ -23,8 +23,7 @@ const char kTestErrorMessage[] = "no_errors";
const WifiCredentialsAttachment::SecurityType kTestSecurityType =
sharing::mojom::WifiCredentialsMetadata::SecurityType::kWpaPsk;
class FakeCrosNetworkConfig
: public chromeos::network_config::CrosNetworkConfig {
class FakeCrosNetworkConfig : public ash::network_config::CrosNetworkConfig {
public:
explicit FakeCrosNetworkConfig(
ash::NetworkStateTestHelper* network_state_test_helper)
@ -82,7 +81,7 @@ TEST(WifiNetworkConfigurationHandlerTest, Success) {
FakeCrosNetworkConfig fake_cros_network_config{&network_state_test_helper};
fake_cros_network_config.SetOutput(kTestNetworkGuid, kTestErrorMessage);
chromeos::network_config::OverrideInProcessInstanceForTesting(
ash::network_config::OverrideInProcessInstanceForTesting(
&fake_cros_network_config);
WifiNetworkConfigurationHandler handler;
@ -124,7 +123,7 @@ TEST(WifiNetworkConfigurationHandlerTest, Failure) {
fake_cros_network_config.SetOutput(/*network_guid=*/absl::nullopt,
kTestErrorMessage);
chromeos::network_config::OverrideInProcessInstanceForTesting(
ash::network_config::OverrideInProcessInstanceForTesting(
&fake_cros_network_config);
WifiNetworkConfigurationHandler handler;

@ -38,7 +38,7 @@
#include "chromeos/ash/components/dbus/shill/shill_manager_client.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/sync_wifi/wifi_configuration_sync_service.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#endif
class SyncServiceFactoryTest : public testing::Test {
@ -184,7 +184,7 @@ class SyncServiceFactoryTest : public testing::Test {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Sets up and tears down the Chrome OS networking mojo service as needed
// for the WIFI_CONFIGURATIONS sync service.
chromeos::network_config::CrosNetworkConfigTestHelper network_config_helper_;
ash::network_config::CrosNetworkConfigTestHelper network_config_helper_;
#endif
};

@ -32,7 +32,7 @@ struct TypeConverter<VpnProviderPtr,
static VpnProviderPtr Convert(
const app_list::ArcVpnProviderManager::ArcVpnProvider* input) {
auto result = VpnProvider::New();
result->type = chromeos::network_config::mojom::VpnType::kArc;
result->type = VpnType::kArc;
result->provider_id = input->package_name;
result->provider_name = input->app_name;
result->app_id = input->app_id;
@ -45,7 +45,7 @@ template <>
struct TypeConverter<VpnProviderPtr, const extensions::Extension*> {
static VpnProviderPtr Convert(const extensions::Extension* input) {
auto result = VpnProvider::New();
result->type = chromeos::network_config::mojom::VpnType::kExtension;
result->type = VpnType::kExtension;
result->provider_id = input->id();
result->provider_name = input->name();
// For Extensions, the app id is the same as the provider id.

@ -9,8 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ash/app_list/arc/arc_vpn_provider_manager.h"
#include "chrome/browser/ash/crosapi/vpn_extension_observer_ash.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/user_manager/user_manager.h"
#include "extensions/browser/extension_registry_observer.h"
#include "mojo/public/cpp/bindings/remote.h"

@ -9,7 +9,7 @@
#include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h"
#include "chrome/common/webui_url_constants.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h" // nogncheck
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "content/public/browser/webui_config.h"
#include "content/public/common/url_constants.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"

@ -22,7 +22,7 @@
#include "chromeos/ash/components/network/network_state.h"
#include "chromeos/ash/components/network/network_state_handler.h"
#include "chromeos/ash/components/network/network_util.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" // nogncheck
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"

@ -7,7 +7,7 @@
#include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h"
#include "chrome/common/webui_url_constants.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h" // nogncheck
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "content/public/browser/webui_config.h"
#include "content/public/common/url_constants.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"

@ -131,7 +131,7 @@
#include "chrome/grit/oobe_unconditional_resources_map.h"
#include "chromeos/ash/services/cellular_setup/public/mojom/esim_manager.mojom.h"
#include "chromeos/ash/services/multidevice_setup/multidevice_setup_service.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" // nogncheck
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_context.h"

@ -18,7 +18,7 @@
#include "chrome/browser/ui/webui/ash/login/core_oobe_handler.h"
#include "chromeos/ash/services/cellular_setup/public/mojom/esim_manager.mojom-forward.h"
#include "chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h" // nogncheck
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "ui/webui/mojo_web_ui_controller.h"
@ -27,6 +27,7 @@ class WebUIDataSource;
}
namespace ash {
class ErrorScreen;
class NetworkStateInformer;
class OobeDisplayChooser;

@ -65,11 +65,6 @@
namespace ash {
// TODO(https://crbug.com/1164001): remove after migrating to ash.
namespace network_config {
namespace mojom = ::chromeos::network_config::mojom;
}
namespace {
constexpr char kAddNetwork[] = "addNetwork";
@ -990,7 +985,8 @@ NetworkUI::NetworkUI(content::WebUI* web_ui)
NetworkUI::~NetworkUI() = default;
void NetworkUI::BindInterface(
mojo::PendingReceiver<network_config::mojom::CrosNetworkConfig> receiver) {
mojo::PendingReceiver<chromeos::network_config::mojom::CrosNetworkConfig>
receiver) {
GetNetworkConfigService(std::move(receiver));
}

@ -33,7 +33,6 @@
#include "ui/chromeos/strings/grit/ui_chromeos_strings.h"
#include "ui/chromeos/strings/network/network_element_localized_strings_provider.h"
// TODO(https://crbug.com/1164001): remove after migrating to ash.
namespace ash::network_config {
namespace mojom = chromeos::network_config::mojom;
}

@ -26,9 +26,10 @@ namespace ash::settings {
class SearchTagRegistry;
class InternetSection : public OsSettingsSection,
public network_config::CrosNetworkConfigObserver,
public hotspot_config::CrosHotspotConfigObserver {
class InternetSection
: public OsSettingsSection,
public chromeos::network_config::CrosNetworkConfigObserver,
public hotspot_config::CrosHotspotConfigObserver {
public:
InternetSection(Profile* profile, SearchTagRegistry* search_tag_registry);
~InternetSection() override;

@ -35,7 +35,7 @@ source_set("unit_tests") {
"//ash/public/cpp",
"//base/test:test_support",
"//chromeos/ash/services/nearby/public/cpp:test_support",
"//chromeos/services/network_config/public/cpp:test_support",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//testing/gmock",
"//testing/gtest",
]

@ -1,5 +1,7 @@
include_rules = [
"+chromeos/ash/services/nearby",
"+chromeos/ash/services/network_config/public/cpp",
"+chromeos/services/network_config/public/mojom",
"+components/webrtc",
"+device/bluetooth/public/mojom",
"+services/network/public/cpp",
@ -11,7 +13,5 @@ include_rules = [
specific_include_rules = {
"sharing_impl_unittest.cc": [
"+ash/public/cpp/network_config_service.h",
"+chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h",
"+chromeos/services/network_config/public/mojom",
],
}

@ -47,7 +47,7 @@ source_set("unit_tests") {
"//ash/public/cpp",
"//base/test:test_support",
"//chromeos/ash/services/nearby/public/cpp:test_support",
"//chromeos/services/network_config/public/cpp:test_support",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/nearby:connections_test_util",

@ -4,13 +4,11 @@
include_rules = [
"+chrome/browser/nearby_sharing/logging",
"+chromeos/services/network_config/public/mojom",
"+third_party/nearby",
]
specific_include_rules = {
"nearby_connections_unittest.cc": [
"+ash/public/cpp/network_config_service.h",
"+chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h",
],
}

@ -29,7 +29,7 @@
#include "chromeos/ash/services/nearby/public/mojom/nearby_decoder.mojom.h"
#include "chromeos/ash/services/nearby/public/mojom/sharing.mojom.h"
#include "chromeos/ash/services/nearby/public/mojom/tcp_socket_factory.mojom.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
@ -423,7 +423,7 @@ class NearbyConnectionsTest : public testing::Test {
mojo::Remote<mojom::NearbyConnections> remote_;
bluetooth::FakeAdapter bluetooth_adapter_;
sharing::MockWebRtcDependencies webrtc_dependencies_;
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<ash::network_config::CrosNetworkConfigTestHelper>
cros_network_config_test_helper_;
mojo::SelfOwnedReceiverRef<sharing::mojom::FirewallHoleFactory>
firewall_hole_factory_self_owned_receiver_ref_;

@ -121,8 +121,8 @@ source_set("unit_tests") {
"//chromeos/ash/services/nearby/public/cpp:tcp_server_socket_port",
"//chromeos/ash/services/nearby/public/cpp:test_support",
"//chromeos/ash/services/nearby/public/mojom",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config/public/cpp:test_support",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//components/onc",
"//components/prefs:test_support",
"//components/sync_preferences:test_support",

@ -4,7 +4,6 @@
include_rules = [
'+ash/constants/ash_features.h',
'+chromeos/services/network_config',
'+device/bluetooth/public',
'+services/network/public',
'+third_party/abseil-cpp/absl/strings/string_view.h',
@ -23,3 +22,9 @@ include_rules = [
'+components/sync_preferences/testing_pref_service_syncable.h',
'+third_party/cros_system_api/dbus/shill/dbus-constants.h',
]
specific_include_rules = {
"wifi_lan_medium_unittest\.cc": [
"+chromeos/ash/services/network_config/in_process_instance.h",
],
}

@ -21,8 +21,8 @@
#include "chromeos/ash/services/nearby/public/cpp/fake_tcp_socket_factory.h"
#include "chromeos/ash/services/nearby/public/cpp/tcp_server_socket_port.h"
#include "chromeos/ash/services/nearby/public/mojom/firewall_hole.mojom.h"
#include "chromeos/services/network_config/in_process_instance.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/in_process_instance.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/onc/onc_constants.h"
#include "components/onc/onc_pref_names.h"
@ -202,7 +202,7 @@ class WifiLanMediumTest : public ::testing::Test {
// Boiler plate to set up a test CrosNetworkConfig mojo service.
void InitializeCrosNetworkConfig(bool use_managed_config_handler) {
cros_network_config_helper_ =
std::make_unique<chromeos::network_config::CrosNetworkConfigTestHelper>(
std::make_unique<ash::network_config::CrosNetworkConfigTestHelper>(
/*initialize=*/false);
if (use_managed_config_handler) {
@ -248,7 +248,7 @@ class WifiLanMediumTest : public ::testing::Test {
cros_network_config_helper_->network_state_helper().ClearDevices();
cros_network_config_helper_->network_state_helper().ClearServices();
chromeos::network_config::BindToInProcessInstance(
ash::network_config::BindToInProcessInstance(
cros_network_config_.BindNewPipeAndPassReceiver());
base::RunLoop().RunUntilIdle();
@ -322,7 +322,7 @@ class WifiLanMediumTest : public ::testing::Test {
std::unique_ptr<ash::UIProxyConfigService> ui_proxy_config_service_;
std::unique_ptr<ash::ManagedNetworkConfigurationHandler>
managed_network_config_handler_;
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<ash::network_config::CrosNetworkConfigTestHelper>
cros_network_config_helper_;
mojo::SharedRemote<chromeos::network_config::mojom::CrosNetworkConfig>
cros_network_config_;

@ -20,7 +20,7 @@
#include "chromeos/ash/services/nearby/public/mojom/nearby_decoder.mojom.h"
#include "chromeos/ash/services/nearby/public/mojom/sharing.mojom.h"
#include "chromeos/ash/services/nearby/public/mojom/tcp_socket_factory.mojom.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
@ -41,8 +41,8 @@ class SharingImplTest : public testing::Test {
/*io_task_runner=*/nullptr);
// Set up CrosNetworkConfig mojo service.
cros_network_config_test_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
cros_network_config_test_helper_ =
std::make_unique<ash::network_config::CrosNetworkConfigTestHelper>();
mojo::PendingRemote<chromeos::network_config::mojom::CrosNetworkConfig>
cros_network_config_remote;
ash::GetNetworkConfigService(
@ -145,7 +145,7 @@ class SharingImplTest : public testing::Test {
mojo::Remote<sharing::mojom::NearbySharingDecoder> decoder_;
bluetooth::FakeAdapter bluetooth_adapter_;
sharing::MockWebRtcDependencies webrtc_dependencies_;
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<ash::network_config::CrosNetworkConfigTestHelper>
cros_network_config_test_helper_;
mojo::SelfOwnedReceiverRef<sharing::mojom::FirewallHoleFactory>
firewall_hole_factory_self_owned_receiver_ref_;

@ -4395,6 +4395,7 @@ if (!is_android) {
"//chromeos/ash/services/auth_factor_config",
"//chromeos/ash/services/cros_healthd/public/cpp",
"//chromeos/ash/services/multidevice_setup/public/cpp:test_support",
"//chromeos/ash/services/network_config",
"//chromeos/components/onc:test_support",
"//chromeos/components/quick_answers/public/cpp:cpp",
"//chromeos/components/remote_apps/mojom:mojom",
@ -4402,7 +4403,6 @@ if (!is_android) {
"//chromeos/dbus/missive:test_support",
"//chromeos/process_proxy",
"//chromeos/services/machine_learning/public/cpp:stub",
"//chromeos/services/network_config:network_config",
"//chromeos/services/tts",
"//chromeos/strings",
"//chromeos/ui/base",
@ -7726,6 +7726,8 @@ test("unit_tests") {
"//chromeos/ash/services/nearby/public/cpp:tcp_server_socket_port",
"//chromeos/ash/services/nearby/public/cpp:test_support",
"//chromeos/ash/services/nearby/public/mojom",
"//chromeos/ash/services/network_config",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/ash/services/secure_channel/public/cpp/client:test_support",
"//chromeos/components/onc",
"//chromeos/components/quick_answers:quick_answers",
@ -7735,8 +7737,6 @@ test("unit_tests") {
"//chromeos/dbus/u2f",
"//chromeos/ime:gencode",
"//chromeos/services/assistant/public/shared",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config:network_config",
"//chromeos/strings",
"//chromeos/ui/base",
"//chromeos/ui/wm",

@ -26,7 +26,6 @@ component("network") {
"//chromeos/components/onc",
"//chromeos/dbus/common",
"//chromeos/dbus/permission_broker",
"//chromeos/services/network_config/public/cpp",
"//chromeos/services/network_config/public/mojom",
"//components/account_id",
"//components/device_event_log",
@ -207,7 +206,6 @@ source_set("test_support") {
"//chromeos:test_utils",
"//chromeos/ash/components/dbus/shill",
"//chromeos/components/onc:test_support",
"//chromeos/services/network_config/public/cpp",
"//chromeos/services/network_config/public/mojom",
"//components/onc",
"//components/sync_preferences:test_support",
@ -266,12 +264,11 @@ source_set("unit_tests") {
"//chromeos/ash/components/network/proxy:unit_tests",
"//chromeos/ash/services/hotspot_config/public/cpp",
"//chromeos/ash/services/hotspot_config/public/mojom",
"//chromeos/ash/services/network_config:in_process_instance",
"//chromeos/ash/services/network_config/public/cpp:test_support",
"//chromeos/components/onc",
"//chromeos/components/onc:test_support",
"//chromeos/dbus/permission_broker",
"//chromeos/services/network_config:in_process_instance",
"//chromeos/services/network_config/public/cpp",
"//chromeos/services/network_config/public/cpp:test_support",
"//components/onc",
"//components/prefs",
"//components/prefs:test_support",

@ -6,12 +6,13 @@ include_rules = [
"+base/component_export.h",
"+chromeos/ash/components/feature_usage",
"+chromeos/ash/components/login/login_state",
"+chromeos/ash/services/hotspot_config/public",
"+chromeos/test",
"+chromeos/ash/components/dbus",
"+chromeos/dbus",
"+chromeos/ash/services/hotspot_config/public",
"+chromeos/ash/services/network_config/public",
"+chromeos/components/onc",
"+chromeos/dbus",
"+chromeos/services/network_config/public",
"+chromeos/test",
"+components/account_id",
"+components/certificate_matching",
"+components/crx_file",

@ -21,7 +21,7 @@
#include "chromeos/ash/components/network/network_state_test_helper.h"
#include "chromeos/ash/components/network/network_ui_data.h"
#include "chromeos/ash/components/network/test_cellular_esim_profile_handler.h"
#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "chromeos/ash/services/network_config/public/cpp/cros_network_config_test_helper.h"
#include "dbus/object_path.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@ -103,8 +103,8 @@ class CellularMetricsLoggerTest : public testing::Test {
new testing::NiceMock<MockManagedNetworkConfigurationHandler>);
cellular_esim_profile_handler_ =
std::make_unique<TestCellularESimProfileHandler>();
network_config_helper_ = std::make_unique<
chromeos::network_config::CrosNetworkConfigTestHelper>();
network_config_helper_ =
std::make_unique<network_config::CrosNetworkConfigTestHelper>();
network_state_test_helper_.hermes_manager_test()->AddEuicc(
dbus::ObjectPath(kTestEuiccPath), kTestEidName, /*is_active=*/true,
@ -272,7 +272,7 @@ class CellularMetricsLoggerTest : public testing::Test {
std::unique_ptr<base::HistogramTester> histogram_tester_;
NetworkStateTestHelper network_state_test_helper_{
false /* use_default_devices_and_services */};
std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper>
std::unique_ptr<network_config::CrosNetworkConfigTestHelper>
network_config_helper_;
std::unique_ptr<CellularInhibitor> cellular_inhibitor_;
std::unique_ptr<TestCellularESimProfileHandler>

@ -18,11 +18,6 @@ namespace ash {
namespace {
// TODO(https://crbug.com/1164001): remove after migrating to ash.
namespace network_config {
namespace mojom = ::chromeos::network_config::mojom;
}
const char kNetworkMetricsPrefix[] = "Network.Ash.";
const char kAllConnectionResultSuffix[] = ".ConnectionResult.All";
const char kUserInitiatedConnectionResultSuffix[] =
@ -108,7 +103,7 @@ const std::vector<std::string> GetWifiNetworkTypeHistograms(
std::vector<std::string> wifi_histograms{kWifi};
if (network_state->GetMojoSecurity() ==
network_config::mojom::SecurityType::kNone) {
chromeos::network_config::mojom::SecurityType::kNone) {
wifi_histograms.emplace_back(kWifiOpen);
} else {
wifi_histograms.emplace_back(kWifiPasswordProtected);

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