Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: chrome/browser/resources/settings/internet_page/network_config_select.js

Issue 2848683003: MD Settings: Add settings-internet-config (WiFi only, no certs) (Closed)
Patch Set: Rebase + add histogram enum Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/internet_page/network_config_select.js
diff --git a/chrome/browser/resources/settings/internet_page/network_config_select.js b/chrome/browser/resources/settings/internet_page/network_config_select.js
new file mode 100644
index 0000000000000000000000000000000000000000..23794bb400f461736b4041bdd35a265517ed0a0e
--- /dev/null
+++ b/chrome/browser/resources/settings/internet_page/network_config_select.js
@@ -0,0 +1,62 @@
+// Copyright 2017 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.
+
+/**
+ * @fileoverview Polymer element for network configuration selection menus.
+ */
+Polymer({
+ is: 'network-config-select',
+
+ behaviors: [I18nBehavior],
+
+ properties: {
+ label: String,
+
+ disabled: Boolean,
+
+ /**
+ * Array of item values to select from.
+ * @type {!Array<string>}
+ */
+ items: Array,
+
+ /** Prefix used to look up ONC property names. */
+ oncPrefix: String,
+
+ /** Select item value */
+ value: {
+ type: String,
+ notify: true,
+ },
+ },
+
+ observers: ['updateSelected_(items, value)'],
+
+ /**
+ * Ensure that the <select> value is updated when |items| or |value| changes.
+ * @private
+ */
+ updateSelected_: function() {
+ // Wait for the dom-repeat to populate the <option> entries.
+ this.async(function() {
+ var select = this.$$('select');
+ if (select.value != this.value)
+ select.value = this.value;
+ });
+ },
+
+ /**
+ * @param {string} key
+ * @param {string} prefix
+ * @return {string} The text to display for the onc value.
+ * @private
+ */
+ getOncLabel_: function(key, prefix) {
+ var oncKey = 'Onc' + prefix.replace(/\./g, '-') + '_' + key;
+ if (this.i18nExists(oncKey))
+ return this.i18n(oncKey);
+ assertNotReached();
+ return key;
+ },
+});
« no previous file with comments | « chrome/browser/resources/settings/internet_page/network_config_select.html ('k') | chrome/browser/resources/settings/route.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698