Commit 2570df9a authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Network details: add proxy policy indicator

Bug: 244951
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I2dd6d733dff382548f1dc6e558ff5ae9973a209c
Reviewed-on: https://chromium-review.googlesource.com/952957
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarToni Barzic <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541877}
parent 95fa02ec
......@@ -19,6 +19,8 @@
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_icon.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/load_time_data.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
......@@ -34,6 +36,10 @@
<dom-module id="internet-detail-dialog">
<template>
<style include="network-shared iron-flex">
cr-policy-network-indicator {
-webkit-margin-end: 10px;
}
.section {
@apply(--cr-section);
margin-bottom: 10px;
......@@ -122,6 +128,15 @@
<!-- Proxy -->
<div class="section single-column">
<template is="dom-if"
if="[[shouldShowProxyPolicyIndicator_(networkProperties)]]">
<div class="property-box">
<cr-policy-network-indicator
property="[[networkProperties.ProxySettings.Type]]">
</cr-policy-network-indicator>
<div>$i18n{networkProxyEnforcedPolicy}</div>
</div>
</template>
<network-proxy editable use-shared-proxies
on-proxy-change="onProxyChange_"
network-properties="[[networkProperties]]">
......
......@@ -10,7 +10,7 @@
Polymer({
is: 'internet-detail-dialog',
behaviors: [I18nBehavior],
behaviors: [CrPolicyNetworkBehavior, I18nBehavior],
properties: {
/** The network GUID to display details for. */
......@@ -277,6 +277,18 @@ Polymer({
CrOnc.ConnectionState.NOT_CONNECTED;
},
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @return {boolean}
* @private
*/
shouldShowProxyPolicyIndicator_: function(networkProperties) {
var property = this.get('ProxySettings.Type', networkProperties);
return !!property &&
this.isNetworkPolicyEnforced(
/** @type {!CrOnc.ManagedProperty} */ (property));
},
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @return {boolean} Whether or not to enable the network connect button.
......
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