Commit fc471bd8 authored by Trent Begin's avatar Trent Begin Committed by Commit Bot

cros_network_config: split shared types into separate mojom file

This splits cros_network_config mojo interface into a shared group of
enums that are reused in Network Health's interface.

Bug: chromium:1057739
Change-Id: I5bc2673f0c856dbbcb689a96282982e795562271
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157769Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Trent Begin <tbegin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763357}
parent da97fb25
......@@ -11,6 +11,7 @@
#include "ash/ash_export.h"
#include "base/strings/string16.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/canvas_image_source.h"
#include "ui/gfx/image/image_skia.h"
......
......@@ -9,6 +9,7 @@
#include "base/strings/string16.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
#include "ui/gfx/image/image_skia.h"
namespace gfx {
......
......@@ -18,6 +18,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
namespace views {
class Separator;
......
......@@ -14,6 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
namespace views {
class Button;
......
......@@ -15,6 +15,7 @@
#include "base/observer_list.h"
#include "base/timer/timer.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
namespace ash {
......
......@@ -10,6 +10,7 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/app_list/arc/arc_vpn_provider_manager.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "components/user_manager/user_manager.h"
#include "extensions/browser/extension_registry_observer.h"
#include "mojo/public/cpp/bindings/remote.h"
......
......@@ -14,6 +14,7 @@
#include "chromeos/dbus/shill/shill_profile_client.h"
#include "chromeos/dbus/shill/shill_service_client.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
namespace chromeos {
......
......@@ -20,4 +20,14 @@
use_base_dir="false"
type="BINDATA"
compress="gzip" />
<include name="IDR_NETWORK_CONFIG_TYPES_MOJOM_HTML"
file="${mojom_root}/chromeos/services/network_config/public/mojom/network_types.mojom.html"
use_base_dir="false"
type="BINDATA"
compress="gzip" />
<include name="IDR_NETWORK_CONFIG_TYPES_MOJOM_LITE_JS"
file="${mojom_root}/chromeos/services/network_config/public/mojom/network_types.mojom-lite.js"
use_base_dir="false"
type="BINDATA"
compress="gzip" />
</grit-part>
......@@ -11,6 +11,7 @@
#include "base/test/task_environment.h"
#include "chromeos/services/assistant/test_support/scoped_assistant_client.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
#include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace chromeos {
......
......@@ -10,8 +10,13 @@ mojom("mojom") {
"cros_network_config.mojom",
]
deps = [
public_deps = [
":network_types",
"//mojo/public/mojom/base",
"//services/network/public/mojom:mojom_ip_address",
]
}
mojom("network_types") {
sources = [ "network_types.mojom" ]
}
......@@ -12,6 +12,7 @@
module chromeos.network_config.mojom;
import "chromeos/services/network_config/public/mojom/network_types.mojom";
import "mojo/public/mojom/base/time.mojom";
import "services/network/public/mojom/ip_address.mojom";
......@@ -32,73 +33,6 @@ enum AuthenticationType {
k8021x,
};
// Connection state of visible networks.
enum ConnectionStateType {
kOnline,
kConnected,
kPortal,
kConnecting,
kNotConnected,
};
// Device / Technology state for devices.
enum DeviceStateType {
kUninitialized,
kDisabled,
kEnabling,
kEnabled,
kProhibited,
// Not used in DeviceStateProperties, but useful when querying by type.
kUnavailable,
};
// The network technology type. NOTE: 'All' and 'Wireless' are only used by
// FilterType for requesting groups of networks.
enum NetworkType {
kAll,
kCellular,
kEthernet,
// Mobile includes Cellular, and Tether.
kMobile,
kTether,
kVPN,
// Wireles includes Cellular, Tether, and WiFi.
kWireless,
kWiFi,
};
// The ONC source for the network configuration, i.e. whether it is stored in
// the User or Device profile and whether it was configured by policy.
enum OncSource {
// The network is not remembered, or the property is not configurable.
kNone,
// The configuration is saved in the user profile.
kUser,
// The configuration is saved in the device profile.
kDevice,
// The configuration came from a user policy and is saved in the user profile.
kUserPolicy,
// The configuration came from a device policy and is saved in the device
// profile.
kDevicePolicy,
};
// The policy source for property values managed by policy.
enum PolicySource {
// The property is not controlled by policy.
kNone,
// The property value came from a user policy and is enforced.
kUserPolicyEnforced,
// The property value came from a device policy and is enforced.
kDevicePolicyEnforced,
// The property value came from a user policy and is recommended.
kUserPolicyRecommended,
// The property value came from a device policy and is recommended.
kDevicePolicyRecommended,
// The property value came from an extension.
kActiveExtension,
};
enum ProxyMode {
// Direct connection to the network.
kDirect,
......@@ -366,7 +300,7 @@ struct PaymentPortalProperties {
// active_value: The value provided by the configuration manager (e.g. Shill).
// This will match |policy_value| when |policy_source| is enforced.
// policy_source: The source of the value provided by policy when available,
// or kNone (see PolicySource).
// or kNone (see PolicySource in network_types.mojom).
// policy_value: The value provided by policy when available.
// Fundamental managed types.
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// These are shared enums used by cros_network_config.
module chromeos.network_config.mojom;
// Connection state of visible networks.
enum ConnectionStateType {
kOnline,
kConnected,
kPortal,
kConnecting,
kNotConnected,
};
// Device / Technology state for devices.
enum DeviceStateType {
kUninitialized,
kDisabled,
kEnabling,
kEnabled,
kProhibited,
// Not used in DeviceStateProperties, but useful when querying by type.
kUnavailable,
};
// The network technology type. NOTE: 'All' and 'Wireless' are only used by
// FilterType for requesting groups of networks.
enum NetworkType {
kAll,
kCellular,
kEthernet,
// Mobile includes Cellular, and Tether.
kMobile,
kTether,
kVPN,
// Wireles includes Cellular, Tether, and WiFi.
kWireless,
kWiFi,
};
// The ONC source for the network configuration, i.e. whether it is stored in
// the User or Device profile and whether it was configured by policy.
enum OncSource {
// The network is not remembered, or the property is not configurable.
kNone,
// The configuration is saved in the user profile.
kUser,
// The configuration is saved in the device profile.
kDevice,
// The configuration came from a user policy and is saved in the user profile.
kUserPolicy,
// The configuration came from a device policy and is saved in the device
// profile.
kDevicePolicy,
};
// The policy source for property values managed by policy.
enum PolicySource {
// The property is not controlled by policy.
kNone,
// The property value came from a user policy and is enforced.
kUserPolicyEnforced,
// The property value came from a device policy and is enforced.
kDevicePolicyEnforced,
// The property value came from a user policy and is recommended.
kUserPolicyRecommended,
// The property value came from a device policy and is recommended.
kDevicePolicyRecommended,
// The property value came from an extension.
kActiveExtension,
};
......@@ -175,6 +175,12 @@ const std::map<int, std::string> CreateChromeosMojoResourceIdToAliasMap() {
{IDR_NETWORK_CONFIG_MOJOM_LITE_JS,
"mojo/chromeos/services/network_config/public/mojom/"
"cros_network_config.mojom-lite.js"},
{IDR_NETWORK_CONFIG_TYPES_MOJOM_HTML,
"mojo/chromeos/services/network_config/public/mojom/"
"network_types.mojom.html"},
{IDR_NETWORK_CONFIG_TYPES_MOJOM_LITE_JS,
"mojo/chromeos/services/network_config/public/mojom/"
"network_types.mojom-lite.js"},
{IDR_IP_ADDRESS_MOJOM_HTML,
"mojo/services/network/public/mojom/"
"ip_address.mojom.html"},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment