summaryrefslogtreecommitdiffstats
path: root/components/onc
diff options
context:
space:
mode:
authorSteven Bennetts <stevenjb@chromium.org>2014-09-11 13:50:25 -0700
committerSteven Bennetts <stevenjb@chromium.org>2014-09-11 20:56:15 +0000
commitb4dd54b73384e5ca0af94aefcef95e4521c338ea (patch)
treefbe22869ad30317d49cbe26965c185467d1af69e /components/onc
parent93c37f1b01ef982bce30d4404562f05c7b1d439e (diff)
downloadchromium_src-b4dd54b73384e5ca0af94aefcef95e4521c338ea.zip
chromium_src-b4dd54b73384e5ca0af94aefcef95e4521c338ea.tar.gz
chromium_src-b4dd54b73384e5ca0af94aefcef95e4521c338ea.tar.bz2
Add ONC 'Source' configuration property
This also includes a bit of JS cleanup to use ONC properties directly where possible. BUG=279351 R=pneubeck@chromium.org Review URL: https://codereview.chromium.org/552113002 Cr-Commit-Position: refs/heads/master@{#294462}
Diffstat (limited to 'components/onc')
-rw-r--r--components/onc/docs/onc_spec.html30
-rw-r--r--components/onc/onc_constants.cc20
-rw-r--r--components/onc/onc_constants.h7
3 files changed, 50 insertions, 7 deletions
diff --git a/components/onc/docs/onc_spec.html b/components/onc/docs/onc_spec.html
index ac2e500..9d3b43c 100644
--- a/components/onc/docs/onc_spec.html
+++ b/components/onc/docs/onc_spec.html
@@ -431,6 +431,36 @@
networks. The format is 00:11:22:AA:BB:CC.
</dd>
+ <dt class="field">Source</dt>
+ <dd>
+ <span class="field_meta">
+ (optional, read-only)
+ <span class="type">string</span>
+ </span>
+ Indicates whether the network is configured and how it is configured:
+ <ul>
+ <li><span class="value">User</span>: Configured for the active
+ user only, i.e. an unshared configuration.</li>
+ <li><span class="value">Device</span>: Configured for all users of the
+ device (e.g laptop), i.e. a shared configuration.</li>
+ <li><span class="value">UserPolicy</span>: Configured by the user
+ policy for the active user.</li>
+ <li><span class="value">DevicePolicy</span>: Configured by the device
+ policy for the device.</li>
+ <li><span class="value">None</span>: Not configured, e.g. a visible
+ but unconfigured WiFi network.</li>
+ </ul>
+ <span class="rule">
+ <span class="rule_id"></span>
+ Allowed values are:
+ <span class="value">User</span>,
+ <span class="value">Device</span>,
+ <span class="value">UserPolicy</span>,
+ <span class="value">DevicePolicy</span>,
+ <span class="value">None</span>
+ </span>
+ </dd>
+
<dt class="field">Priority</dt>
<dd>
<span class="field_meta">
diff --git a/components/onc/onc_constants.cc b/components/onc/onc_constants.cc
index 5aa0903..11e3e4e 100644
--- a/components/onc/onc_constants.cc
+++ b/components/onc/onc_constants.cc
@@ -33,22 +33,28 @@ const char kUnencryptedConfiguration[] = "UnencryptedConfiguration";
// Network Configuration
namespace network_config {
const char kCellular[] = "Cellular";
+const char kConnectable[] = "Connectable";
+const char kConnectionState[] = "ConnectionState";
const char kDevice[] = "Device";
+const char kErrorState[] = "ErrorState";
const char kEthernet[] = "Ethernet";
const char kGUID[] = "GUID";
const char kIPConfigs[] = "IPConfigs";
-const char kSavedIPConfig[] = "SavedIPConfig";
-const char kStaticIPConfig[] = "StaticIPConfig";
const char kMacAddress[] = "MacAddress";
-const char kName[] = "Name";
const char kNameServers[] = "NameServers";
+const char kName[] = "Name";
const char kPriority[] = "Priority";
const char kProxySettings[] = "ProxySettings";
-const char kSearchDomains[] = "SearchDomains";
-const char kConnectionState[] = "ConnectionState";
const char kRestrictedConnectivity[] = "RestrictedConnectivity";
-const char kConnectable[] = "Connectable";
-const char kErrorState[] = "ErrorState";
+const char kSavedIPConfig[] = "SavedIPConfig";
+const char kSearchDomains[] = "SearchDomains";
+const char kSourceDevice[] = "Device";
+const char kSourceDevicePolicy[] = "DevicePolicy";
+const char kSourceNone[] = "None";
+const char kSourceUser[] = "User";
+const char kSourceUserPolicy[] = "UserPolicy";
+const char kSource[] = "Source";
+const char kStaticIPConfig[] = "StaticIPConfig";
const char kType[] = "Type";
const char kVPN[] = "VPN";
const char kWiFi[] = "WiFi";
diff --git a/components/onc/onc_constants.h b/components/onc/onc_constants.h
index 0029ca7..14ddb98 100644
--- a/components/onc/onc_constants.h
+++ b/components/onc/onc_constants.h
@@ -13,6 +13,7 @@ namespace onc {
// Indicates from which source an ONC blob comes from.
enum ONCSource {
+ ONC_SOURCE_UNKNOWN,
ONC_SOURCE_NONE,
ONC_SOURCE_USER_IMPORT,
ONC_SOURCE_DEVICE_POLICY,
@@ -69,6 +70,12 @@ ONC_EXPORT extern const char kNameServers[];
ONC_EXPORT extern const char kPriority[];
ONC_EXPORT extern const char kProxySettings[];
ONC_EXPORT extern const char kSearchDomains[];
+ONC_EXPORT extern const char kSource[];
+ONC_EXPORT extern const char kSourceDevice[];
+ONC_EXPORT extern const char kSourceDevicePolicy[];
+ONC_EXPORT extern const char kSourceNone[];
+ONC_EXPORT extern const char kSourceUser[];
+ONC_EXPORT extern const char kSourceUserPolicy[];
ONC_EXPORT extern const char kConnectionState[];
ONC_EXPORT extern const char kRestrictedConnectivity[];
ONC_EXPORT extern const char kConnectable[];