Commit 5e7e0b20 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

WebUI: Move network elements to ui/webui/resources/chromeos

This moves the network_property_list element and network
elements that depend on it (apnlist, ip_config, nameservers)
to a shared location so that they can be used by Web UI dialogs.

Bug: 748204
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I9d4b57167c31a8ed1811aa680838e3ba38105df2
Reviewed-on: https://chromium-review.googlesource.com/596410
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491768}
parent 5d41571e
......@@ -1171,9 +1171,12 @@
<message name="IDS_SETTINGS_INTERNET_CONFIG_SAVE_CREDENTIALS" desc="Settings > Internet > Network config: Label for the setting to save identity and password.">
Save identity and password
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SECTION_ACCESS_POINT" desc="Settings > Internet > Network details: Access Point section label.">
<message name="IDS_SETTINGS_INTERNET_NETWORK_ACCESS_POINT" desc="Settings > Internet > Network details: Access Point section label.">
Access Point
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_NAMESERVERS" desc="Settings > Network: Name servers label.">
Name servers
</message>
<message name="IDS_SETTINGS_INTERNET_MOBILE_SEARCH" desc="Settings > Internet > Message in Mobile section when searching for mobile networks.">
Searching for mobile networks
</message>
......@@ -1183,9 +1186,6 @@
<message name="IDS_SETTINGS_INTERNET_NETWORK_SECTION_ADVANCED_ACCESSIBILITY_LABEL" desc="Label for the button that toggles showing the advanced network properties. Only visible by screen reader software.">
Show advanced network properties
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SECTION_NAMESERVERS" desc="Settings > Internet > Network details: Name servers section label.">
Name servers
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SECTION_NETWORK" desc="Settings > Internet > Network details: Network section label.">
Network
</message>
......
......@@ -70,13 +70,6 @@
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_apnlist',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_config_input',
'dependencies': [],
......@@ -90,30 +83,6 @@
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_ip_config',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_nameservers',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_property_list',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
'<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_network_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_proxy',
'dependencies': [
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/chromeos/network/network_apnlist.html">
<link rel="import" href="chrome://resources/chromeos/network/network_ip_config.html">
<link rel="import" href="chrome://resources/chromeos/network/network_nameservers.html">
<link rel="import" href="chrome://resources/chromeos/network/network_property_list.html">
<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/cr_expand_button/cr_expand_button.html">
......@@ -17,10 +21,6 @@
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../route.html">
<link rel="import" href="internet_shared_css.html">
<link rel="import" href="network_apnlist.html">
<link rel="import" href="network_ip_config.html">
<link rel="import" href="network_nameservers.html">
<link rel="import" href="network_property_list.html">
<link rel="import" href="network_proxy.html">
<link rel="import" href="network_siminfo.html">
<link rel="import" href="tether_connection_dialog.html">
......@@ -53,6 +53,14 @@
border-top: none;
}
.settings-box.indented {
-webkit-margin-start: var(--settings-box-row-padding);
}
.settings-box.stretch {
align-items: stretch;
}
#networkState[connected] {
color: var(--google-green-500);
}
......
......@@ -22,14 +22,6 @@
margin-top: -9px;
}
.settings-box.indented {
-webkit-margin-start: var(--settings-box-row-padding);
}
.settings-box.stretch {
align-items: stretch;
}
.title {
font-size: 107.69%; /* 14px / 13px */
font-weight: 500;
......
......@@ -1189,12 +1189,6 @@
<structure name="IDR_SETTINGS_MULTIDEVICE_PAGE_JS"
file="multidevice_page/multidevice_page.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_APNLIST_HTML"
file="internet_page/network_apnlist.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_APNLIST_JS"
file="internet_page/network_apnlist.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_CONFIG_INPUT_HTML"
file="internet_page/network_config_input.html"
type="chrome_html" />
......@@ -1207,24 +1201,6 @@
<structure name="IDR_SETTINGS_NETWORK_CONFIG_SELECT_JS"
file="internet_page/network_config_select.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_IP_CONFIG_HTML"
file="internet_page/network_ip_config.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_IP_CONFIG_JS"
file="internet_page/network_ip_config.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_NAMESERVERS_HTML"
file="internet_page/network_nameservers.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_NAMESERVERS_JS"
file="internet_page/network_nameservers.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_PROPERTY_LIST_HTML"
file="internet_page/network_property_list.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_PROPERTY_LIST_JS"
file="internet_page/network_property_list.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_PROXY_HTML"
file="internet_page/network_proxy.html"
type="chrome_html" />
......
......@@ -992,14 +992,12 @@ void AddInternetStrings(content::WebUIDataSource* html_source) {
{"networkProxyTypePac", IDS_SETTINGS_INTERNET_NETWORK_PROXY_TYPE_PAC},
{"networkProxyTypeWpad", IDS_SETTINGS_INTERNET_NETWORK_PROXY_TYPE_WPAD},
{"networkProxyUseSame", IDS_SETTINGS_INTERNET_NETWORK_PROXY_USE_SAME},
{"networkSectionAccessPoint",
IDS_SETTINGS_INTERNET_NETWORK_SECTION_ACCESS_POINT},
{"networkAccessPoint", IDS_SETTINGS_INTERNET_NETWORK_ACCESS_POINT},
{"networkNameservers", IDS_SETTINGS_INTERNET_NETWORK_NAMESERVERS},
{"networkSectionAdvanced",
IDS_SETTINGS_INTERNET_NETWORK_SECTION_ADVANCED},
{"networkSectionAdvancedA11yLabel",
IDS_SETTINGS_INTERNET_NETWORK_SECTION_ADVANCED_ACCESSIBILITY_LABEL},
{"networkSectionNameservers",
IDS_SETTINGS_INTERNET_NETWORK_SECTION_NAMESERVERS},
{"networkSectionNetwork", IDS_SETTINGS_INTERNET_NETWORK_SECTION_NETWORK},
{"networkSectionNetworkExpandA11yLabel",
IDS_SETTINGS_INTERNET_NETWORK_SECTION_NETWORK_ACCESSIBILITY_LABEL},
......
......@@ -3,6 +3,13 @@
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'network_resources',
'type': 'none',
'dependencies': [
'network/compiled_resources2.gyp:*',
],
},
{
'target_name': 'bluetooth_dialog',
'dependencies': [
......
# Copyright 2016 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.
{
'targets': [
{
'target_name': 'network_apnlist',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_ip_config',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_nameservers',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'network_property_list',
'dependencies': [
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
'<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_network_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="../settings_vars_css.html">
<link rel="import" href="internet_shared_css.html">
<link rel="import" href="network_property_list.html">
<link rel="import" href="network_shared_css.html">
<dom-module id="network-apnlist">
<template>
<style include="internet-shared md-select">
<style include="network-shared md-select">
paper-button {
margin: 4px 0 20px;
margin: 4px 0;
}
</style>
<div class="settings-box first">
<div class="start">$i18n{networkSectionAccessPoint}</div>
<div class="property-box first">
<div class="start">[[i18n('networkAccessPoint')]]</div>
<div class="md-select-wrapper">
<select id="selectApn" class="md-select" on-change="onSelectApnChange_"
value="[[selectedApn_]]"
aria-label="$i18n{networkSectionAccessPoint}">
aria-label="[[i18n('networkAccessPoint')]]">
<template is="dom-repeat" items="[[apnSelectList_]]">
<option value="[[item.AccessPointName]]">[[apnDesc_(item)]]</option>
</template>
......@@ -28,14 +28,14 @@
</div>
</div>
<div class="settings-box continuation single-column"
<div class="property-box continuation single-column"
hidden$="[[!isOtherSelected_(selectedApn_, networkProperties)]]">
<network-property-list on-property-change="onOtherApnChange_"
fields="[[otherApnFields_]]" property-dict="[[otherApn_]]"
edit-field-types="[[otherApnEditTypes_]]" prefix="Cellular.APN.">
</network-property-list>
<paper-button class="action-button" on-tap="onSaveOtherTap_">
$i18n{save}
[[i18n('save')]]
</paper-button>
</div>
</template>
......
......@@ -9,6 +9,8 @@
Polymer({
is: 'network-apnlist',
behaviors: [I18nBehavior],
properties: {
/**
* The current set of properties for the network matching |guid|.
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="internet_shared_css.html">
<link rel="import" href="network_property_list.html">
<link rel="import" href="network_shared_css.html">
<dom-module id="network-ip-config">
<template>
<style include="internet-shared"></style>
<div class="settings-box first">
<div id="autoIPConfigLabel" class="start">$i18n{networkIPConfigAuto}</div>
<style include="network-shared iron-flex"></style>
<div class="property-box first">
<div id="autoIPConfigLabel" class="start">
[[i18n('networkIPConfigAuto')]]
</div>
<paper-toggle-button checked="{{automatic_}}" disabled="[[!editable]]"
aria-labelledby="autoIPConfigLabel">
</paper-toggle-button>
</div>
<div class="settings-box single-column continuation indented stretch"
<div class="property-box single-column continuation indented stretch"
hidden$="[[!ipConfig_]]">
<network-property-list
fields="[[ipConfigFields_]]" property-dict="[[ipConfig_]]"
......
......@@ -10,6 +10,8 @@
Polymer({
is: 'network-ip-config',
behaviors: [I18nBehavior],
properties: {
/**
* The network properties dictionary containing the IP Config properties to
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html">
<link rel="import" href="../settings_vars_css.html">
<link rel="import" href="internet_shared_css.html">
<link rel="import" href="network_shared_css.html">
<dom-module id="network-nameservers">
<template>
<style include="internet-shared md-select">
<style include=" network-shared md-select">
paper-input-container {
-webkit-padding-start: 4px;
}
</style>
<div class="settings-box first">
<div class="start">$i18n{networkSectionNameservers}</div>
<div class="property-box first">
<div class="start">[[i18n('networkNameservers')]]</div>
<div class="md-select-wrapper">
<select id="nameserverType" class="md-select" on-change="onTypeChange_"
value="[[nameserversType_]]"
aria-label="$i18n{networkSectionNameservers}">
aria-label="[[i18n('networkNameservers')]]">
<template is="dom-repeat" items="[[nameserverTypeNames_]]">
<option value="[[item]]">[[nameserverTypeDesc_(item)]]</option>
</template>
......@@ -28,7 +28,7 @@
</div>
</div>
<div class="settings-box continuation single-column indented"
<div class="property-box continuation single-column indented"
hidden$="[[!nameservers_.length]]">
<template is="dom-repeat" items="[[nameservers_]]">
<paper-input-container no-label-float>
......
......@@ -8,6 +8,8 @@
Polymer({
is: 'network-nameservers',
behaviors: [I18nBehavior],
properties: {
/**
* The network properties dictionary containing the nameserver properties to
......
......@@ -6,33 +6,28 @@
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html">
<link rel="import" href="internet_shared_css.html">
<link rel="import" href="network_shared_css.html">
<dom-module id="network-property-list">
<template>
<style include="internet-shared iron-flex">
<style include="network-shared iron-flex">
paper-input-container {
margin-bottom: -12px;
margin-top: -8px;
}
/* Property lists are embedded; stretch the box and remove the padding. */
.settings-box {
align-items: stretch;
/* Property lists are embedded; remove the padding. */
.property-box {
padding: 0;
}
.settings-box:first-of-type {
border-top: none;
}
cr-policy-network-indicator {
-webkit-margin-start: var(--settings-controlled-by-spacing);
}
</style>
<template is="dom-repeat" items="[[fields]]"
filter="[[computeFilter_(prefix, propertyDict, editFieldTypes)]]">
<div class="settings-box single-column two-line">
<div class="property-box single-column stretch">
<!-- Property label -->
<div>[[getPropertyLabel_(item, prefix)]]</div>
<!-- Uneditable property value -->
......
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<!-- Common styles for network elements. -->
<dom-module id="network-shared">
<template>
<style include="cr-shared-style">
/* This mirrors .settings-box.two-line. */
.property-box {
align-items: center;
border-top: var(--cr-separator-line);
display: flex;
min-height: 64px; /* matches --settings-row-two-line-min-height */
padding: 0 20px; /* matches --settings-box-row-padding */
}
.property-box.first,
.property-box.continuation {
border-top: none;
}
.property-box.indented {
-webkit-margin-start: 20px; /* matches --settings-box-row-padding */
}
.property-box.single-column {
align-items: flex-start;
flex-direction: column;
justify-content: center;
}
.property-box.stretch {
align-items: stretch;
}
.property-box > .start {
align-items: center;
flex: auto;
}
paper-input-container {
--paper-input-container-input: {
color: var(--paper-grey-600);
font-size: inherit;
font-weight: 400;
};
margin-bottom: 0;
margin-top: -9px;
}
</style>
</template>
</dom-module>
......@@ -7,4 +7,31 @@
<structure name="IDR_WEBUI_CHROMEOS_BLUETOOTH_DIALOG_JS"
file="chromeos/bluetooth_dialog.js"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_APNLIST_HTML"
file="chromeos/network/network_apnlist.html"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_APNLIST_JS"
file="chromeos/network/network_apnlist.js"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_IP_CONFIG_HTML"
file="chromeos/network/network_ip_config.html"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_IP_CONFIG_JS"
file="chromeos/network/network_ip_config.js"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_NAMESERVERS_HTML"
file="chromeos/network/network_nameservers.html"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_NAMESERVERS_JS"
file="chromeos/network/network_nameservers.js"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_PROPERTY_LIST_HTML"
file="chromeos/network/network_property_list.html"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_PROPERTY_LIST_JS"
file="chromeos/network/network_property_list.js"
type="chrome_html" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_SHARED_CSS_HTML"
file="chromeos/network/network_shared_css.html"
type="chrome_html" />
</grit-part>
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