| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 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 displaying and editing a single |
| 7 * network proxy value. When the URL or port changes, a 'changed' event is |
| 8 * fired with the combined url and port values passed as a single string, |
| 9 * url:port. |
| 10 */ |
| 11 Polymer({ |
| 12 is: 'network-proxy-input', |
| 13 |
| 14 properties: { |
| 15 /** |
| 16 * Whether or not the proxy value can be edited. |
| 17 */ |
| 18 editable: { |
| 19 type: Boolean, |
| 20 value: false |
| 21 }, |
| 22 |
| 23 /** |
| 24 * A label for the proxy value. |
| 25 */ |
| 26 label: { |
| 27 type: String, |
| 28 value: 'Proxy' |
| 29 }, |
| 30 |
| 31 /** |
| 32 * The proxy object. |
| 33 * @type {?CrOnc.ProxyLocation} |
| 34 */ |
| 35 value: { |
| 36 type: Object, |
| 37 value: function() { return { Host: '', Port: 80 }; }, |
| 38 notify: true |
| 39 }, |
| 40 }, |
| 41 |
| 42 /** |
| 43 * Event triggered when an input value changes. |
| 44 * @private |
| 45 */ |
| 46 onValueChanged_: function() { |
| 47 var port = parseInt(this.value.Port); |
| 48 if (isNaN(port)) |
| 49 port = 80; |
| 50 this.value.Port = port; |
| 51 this.fire('changed', { value: this.value }); |
| 52 } |
| 53 }); |
| OLD | NEW |