OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 information about WiFi, | 6 * @fileoverview Polymer element for displaying information about WiFi, |
7 * WiMAX, or virtual networks. | 7 * WiMAX, or virtual networks. |
8 */ | 8 */ |
9 | 9 |
10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ | 10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 /** | 410 /** |
411 * Handles UI requests to connect to a network. | 411 * Handles UI requests to connect to a network. |
412 * TODO(stevenjb): Handle Cellular activation, etc. | 412 * TODO(stevenjb): Handle Cellular activation, etc. |
413 * @param {!CrOnc.NetworkStateProperties} state The network state. | 413 * @param {!CrOnc.NetworkStateProperties} state The network state. |
414 * @private | 414 * @private |
415 */ | 415 */ |
416 connectToNetwork_: function(state) { | 416 connectToNetwork_: function(state) { |
417 this.networkingPrivate.startConnect(state.GUID, function() { | 417 this.networkingPrivate.startConnect(state.GUID, function() { |
418 if (chrome.runtime.lastError) { | 418 if (chrome.runtime.lastError) { |
419 var message = chrome.runtime.lastError.message; | 419 var message = chrome.runtime.lastError.message; |
420 if (message != 'connecting') { | 420 if (message == 'connecting' || message == 'connect-canceled' || |
421 console.error( | 421 message == 'connected' || message == 'Error.InvalidNetworkGuid') { |
422 'Unexpected networkingPrivate.startConnect error: ' + message + | 422 return; |
423 'For: ' + state.GUID); | |
424 } | 423 } |
| 424 console.error( |
| 425 'Unexpected networkingPrivate.startConnect error: ' + message + |
| 426 ' For: ' + state.GUID); |
425 } | 427 } |
426 }); | 428 }); |
427 }, | 429 }, |
428 | 430 |
429 /** | 431 /** |
430 * @param {*} lhs | 432 * @param {*} lhs |
431 * @param {*} rhs | 433 * @param {*} rhs |
432 * @return {boolean} | 434 * @return {boolean} |
433 */ | 435 */ |
434 isEqual_: function(lhs, rhs) { | 436 isEqual_: function(lhs, rhs) { |
435 return lhs === rhs; | 437 return lhs === rhs; |
436 }, | 438 }, |
437 }); | 439 }); |
OLD | NEW |