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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview Polymer element for network configuration selection menus.
7 */
8 Polymer({
9 is: 'network-config-select',
10
11 behaviors: [I18nBehavior],
12
13 properties: {
14 label: String,
15
16 disabled: Boolean,
17
18 /**
19 * Array of item values to select from.
20 * @type {!Array<string>}
21 */
22 items: Array,
23
24 /** Prefix used to look up ONC property names. */
25 oncPrefix: String,
26
27 /** Select item value */
28 value: {
29 type: String,
30 notify: true,
31 },
32 },
33
34 observers: ['updateSelected_(items, value)'],
35
36 /**
37 * Ensure that the <select> value is updated when |items| or |value| changes.
38 * @private
39 */
40 updateSelected_: function() {
41 // Wait for the dom-repeat to populate the <option> entries.
42 this.async(function() {
43 var select = this.$$('select');
44 if (select.value != this.value)
45 select.value = this.value;
46 });
47 },
48
49 /**
50 * @param {string} key
51 * @param {string} prefix
52 * @return {string} The text to display for the onc value.
53 * @private
54 */
55 getOncLabel_: function(key, prefix) {
56 var oncKey = 'Onc' + prefix.replace(/\./g, '-') + '_' + key;
57 if (this.i18nExists(oncKey))
58 return this.i18n(oncKey);
59 assertNotReached();
60 return key;
61 },
62 });
OLDNEW
« 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