| 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 | 6 * @fileoverview |
| 7 * 'settings-internet-page' is the settings page containing internet | 7 * 'settings-internet-page' is the settings page containing internet |
| 8 * settings. | 8 * settings. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 }, | 23 }, |
| 24 | 24 |
| 25 /** Preferences state. */ | 25 /** Preferences state. */ |
| 26 prefs: { | 26 prefs: { |
| 27 type: Object, | 27 type: Object, |
| 28 notify: true, | 28 notify: true, |
| 29 }, | 29 }, |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * The device state for each network device type. Set by network-summary. | 32 * The device state for each network device type. Set by network-summary. |
| 33 * @type {!Object<chrome.networkingPrivate.DeviceStateProperties>|undefined} | 33 * @type {!Object<!CrOnc.DeviceStateProperties>|undefined} |
| 34 * @private | 34 * @private |
| 35 */ | 35 */ |
| 36 deviceStates: { | 36 deviceStates: { |
| 37 type: Object, | 37 type: Object, |
| 38 notify: true, | 38 notify: true, |
| 39 }, | 39 }, |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * Highest priority connected network or null. Set by network-summary. | 42 * Highest priority connected network or null. Set by network-summary. |
| 43 * @type {?CrOnc.NetworkStateProperties|undefined} | 43 * @type {?CrOnc.NetworkStateProperties|undefined} |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 /** | 385 /** |
| 386 * chrome.management.onDisabled event. | 386 * chrome.management.onDisabled event. |
| 387 * @param {{id: string}} extension | 387 * @param {{id: string}} extension |
| 388 * @private | 388 * @private |
| 389 */ | 389 */ |
| 390 onExtensionDisabled_: function(extension) { | 390 onExtensionDisabled_: function(extension) { |
| 391 this.onExtensionRemoved_(extension.id); | 391 this.onExtensionRemoved_(extension.id); |
| 392 }, | 392 }, |
| 393 | 393 |
| 394 /** | 394 /** |
| 395 * @param {!chrome.networkingPrivate.DeviceStateProperties} deviceState | 395 * @param {!CrOnc.DeviceStateProperties} deviceState |
| 396 * @return {boolean} | 396 * @return {boolean} |
| 397 * @private | 397 * @private |
| 398 */ | 398 */ |
| 399 deviceIsEnabled_: function(deviceState) { | 399 deviceIsEnabled_: function(deviceState) { |
| 400 return !!deviceState && | 400 return !!deviceState && deviceState.State == CrOnc.DeviceState.ENABLED; |
| 401 deviceState.State == chrome.networkingPrivate.DeviceStateType.ENABLED; | |
| 402 }, | 401 }, |
| 403 | 402 |
| 404 /** | 403 /** |
| 405 * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy | 404 * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy |
| 406 * @return {boolean} | 405 * @return {boolean} |
| 407 */ | 406 */ |
| 408 allowAddConnection_: function(globalPolicy) { | 407 allowAddConnection_: function(globalPolicy) { |
| 409 return !globalPolicy.AllowOnlyPolicyNetworksToConnect; | 408 return !globalPolicy.AllowOnlyPolicyNetworksToConnect; |
| 410 }, | 409 }, |
| 411 | 410 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 442 | 441 |
| 443 this.networkingPrivate.startConnect(properties.GUID, function() { | 442 this.networkingPrivate.startConnect(properties.GUID, function() { |
| 444 if (chrome.runtime.lastError) { | 443 if (chrome.runtime.lastError) { |
| 445 var message = chrome.runtime.lastError.message; | 444 var message = chrome.runtime.lastError.message; |
| 446 if (message == 'connecting' || message == 'connect-canceled' || | 445 if (message == 'connecting' || message == 'connect-canceled' || |
| 447 message == 'connected' || message == 'Error.InvalidNetworkGuid') { | 446 message == 'connected' || message == 'Error.InvalidNetworkGuid') { |
| 448 return; | 447 return; |
| 449 } | 448 } |
| 450 console.error( | 449 console.error( |
| 451 'Unexpected networkingPrivate.startConnect error: ' + message + | 450 'Unexpected networkingPrivate.startConnect error: ' + message + |
| 452 ' For: ' + properties.GUID); | 451 ' For: ' + properties.GUID); |
| 453 } | 452 } |
| 454 }); | 453 }); |
| 455 }, | 454 }, |
| 456 }); | 455 }); |
| OLD | NEW |