| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 */ | 329 */ |
| 330 getProxySettingsTypeProperty_: function() { | 330 getProxySettingsTypeProperty_: function() { |
| 331 return /** @type {!CrOnc.ManagedProperty|undefined} */ ( | 331 return /** @type {!CrOnc.ManagedProperty|undefined} */ ( |
| 332 this.get('ProxySettings.Type', this.networkProperties)); | 332 this.get('ProxySettings.Type', this.networkProperties)); |
| 333 }, | 333 }, |
| 334 | 334 |
| 335 /** | 335 /** |
| 336 * @return {boolean} | 336 * @return {boolean} |
| 337 * @private | 337 * @private |
| 338 */ | 338 */ |
| 339 getShowNetworkPolicyIndicator_: function() { | 339 shouldShowNetworkPolicyIndicator_: 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 shouldShowExtensionIndicator_: function() { |
| 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 shouldShowAllowShared_: function(property) { |
| 360 return !this.isControlled(property) && this.isShared_(); | 360 return !this.isControlled(property) && this.isShared_(); |
| 361 }, | 361 }, |
| 362 | 362 |
| 363 /** | 363 /** |
| 364 * @param {!CrOnc.ManagedProperty|undefined} property | 364 * @param {!CrOnc.ManagedProperty|undefined} property |
| 365 * @return {boolean} Whether the property setting is enforced. | 365 * @return {boolean} Whether the property setting is enforced. |
| 366 * @private | 366 * @private |
| 367 */ | 367 */ |
| 368 isEditable_: function(property) { | 368 isEditable_: function(property) { |
| 369 return this.editable && !this.isNetworkPolicyEnforced(property) && | 369 return this.editable && !this.isNetworkPolicyEnforced(property) && |
| (...skipping 12 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); |
| 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 |