Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Polymer element for displaying and editing network proxy | 6 * @fileoverview Polymer element for displaying and editing network proxy |
| 7 * values. | 7 * values. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'network-proxy', | 10 is: 'network-proxy', |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 getShowNetworkPolicyIndicator_: function() { | 339 getShowNetworkPolicyIndicator_: function() { |
| 340 let property = this.getProxySettingsTypeProperty_(); | 340 let property = this.getProxySettingsTypeProperty_(); |
| 341 return !!property && !this.isExtensionControlled(property) && | 341 return !!property && !this.isExtensionControlled(property) && |
| 342 this.isNetworkPolicyEnforced(property); | 342 this.isNetworkPolicyEnforced(property); |
| 343 }, | 343 }, |
| 344 | 344 |
| 345 /** | 345 /** |
| 346 * @return {boolean} | 346 * @return {boolean} |
| 347 * @private | 347 * @private |
| 348 */ | 348 */ |
| 349 getShowPrefPolicyIndicator_: function() { | 349 getShowExtensionPolicyIndicator_: function() { |
|
Dan Beam
2016/11/29 05:25:34
why does this use 2 verbs? "get" AND "show"? why
stevenjb
2016/11/30 22:58:19
-> shouldShowExtensionIndicator
| |
| 350 let property = this.getProxySettingsTypeProperty_(); | 350 let property = this.getProxySettingsTypeProperty_(); |
| 351 return !!property && this.isExtensionControlled(property); | 351 return !!property && this.isExtensionControlled(property); |
| 352 }, | 352 }, |
| 353 | 353 |
| 354 /** | 354 /** |
| 355 * @param {!CrOnc.ManagedProperty} property | 355 * @param {!CrOnc.ManagedProperty} property |
| 356 * @return {boolean} | 356 * @return {boolean} |
| 357 * @private | 357 * @private |
| 358 */ | 358 */ |
| 359 getShowAllowShared_: function(property) { | 359 getShowAllowShared_: function(property) { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 382 | 382 |
| 383 /** | 383 /** |
| 384 * Used to check the editable state for proxy related UI that may or may | 384 * Used to check the editable state for proxy related UI that may or may |
| 385 * not be directly controlled by a policy. We use the enforced state of the | 385 * not be directly controlled by a policy. We use the enforced state of the |
| 386 * 'ProxySettings.Type' property for these controls. | 386 * 'ProxySettings.Type' property for these controls. |
| 387 * @return {boolean} Whether the proxy control is editable. | 387 * @return {boolean} Whether the proxy control is editable. |
| 388 * @private | 388 * @private |
| 389 */ | 389 */ |
| 390 isProxyEditable_: function() { | 390 isProxyEditable_: function() { |
| 391 let property = this.getProxySettingsTypeProperty_(); | 391 let property = this.getProxySettingsTypeProperty_(); |
| 392 return !!property && this.isEditable_(property); | 392 return !property || this.isEditable_(property); |
|
Dan Beam
2016/11/29 05:25:34
can you test this logic?
stevenjb
2016/11/30 22:58:19
We *should* test all of 'internet'. We currently t
Dan Beam
2016/12/02 00:23:50
now's a great time to start.
Dan Beam
2016/12/02 00:59:49
let me expound on this: the more code you write, t
stevenjb
2016/12/02 17:36:58
I am not unaware of any of this. The question has
| |
| 393 }, | 393 }, |
| 394 | 394 |
| 395 /** | 395 /** |
| 396 * @param {string} property The property to test | 396 * @param {string} property The property to test |
| 397 * @param {string} value The value to test against | 397 * @param {string} value The value to test against |
| 398 * @return {boolean} True if property == value | 398 * @return {boolean} True if property == value |
| 399 * @private | 399 * @private |
| 400 */ | 400 */ |
| 401 matches_: function(property, value) { | 401 matches_: function(property, value) { |
| 402 return property == value; | 402 return property == value; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 426 * Handles the shared proxy confirmation dialog 'Cancel' button or a cancel | 426 * Handles the shared proxy confirmation dialog 'Cancel' button or a cancel |
| 427 * event. | 427 * event. |
| 428 * @private | 428 * @private |
| 429 */ | 429 */ |
| 430 onAllowSharedDialogCancel_: function() { | 430 onAllowSharedDialogCancel_: function() { |
| 431 /** @type {!SettingsCheckboxElement} */ (this.$.allowShared) | 431 /** @type {!SettingsCheckboxElement} */ (this.$.allowShared) |
| 432 .resetToPrefValue(); | 432 .resetToPrefValue(); |
| 433 this.$.confirmAllowSharedDialog.close(); | 433 this.$.confirmAllowSharedDialog.close(); |
| 434 }, | 434 }, |
| 435 }); | 435 }); |
| OLD | NEW |