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

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

Issue 1219753007: Add network proxy input to md-settings internet details (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_470445_onc_proxy
Patch Set: Rebase Created 5 years, 5 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_proxy_input.js
diff --git a/chrome/browser/resources/settings/internet_page/network_proxy_input.js b/chrome/browser/resources/settings/internet_page/network_proxy_input.js
new file mode 100644
index 0000000000000000000000000000000000000000..a4806ff14677a9db9820c4ac95394dcda473bc9f
--- /dev/null
+++ b/chrome/browser/resources/settings/internet_page/network_proxy_input.js
@@ -0,0 +1,53 @@
+// Copyright 2015 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 displaying and editing a single
+ * network proxy value. When the URL or port changes, a 'changed' event is
+ * fired with the combined url and port values passed as a single string,
+ * url:port.
+ */
+Polymer({
+ is: 'network-proxy-input',
+
+ properties: {
+ /**
+ * Whether or not the proxy value can be edited.
+ */
+ editable: {
+ type: Boolean,
+ value: false
+ },
+
+ /**
+ * A label for the proxy value.
+ */
+ label: {
+ type: String,
+ value: 'Proxy'
+ },
+
+ /**
+ * The proxy object.
+ * @type {?CrOnc.ProxyLocation}
+ */
+ value: {
+ type: Object,
+ value: function() { return { Host: '', Port: 80 }; },
+ notify: true
+ },
+ },
+
+ /**
+ * Event triggered when an input value changes.
+ * @private
+ */
+ onValueChanged_: function() {
+ var port = parseInt(this.value.Port);
+ if (isNaN(port))
+ port = 80;
+ this.value.Port = port;
+ this.fire('changed', { value: this.value });
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698