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-detail' is the settings subpage containing details | 7 * 'settings-internet-detail' is the settings subpage containing details |
8 * for a network. | 8 * for a network. |
9 */ | 9 */ |
10 (function() { | 10 (function() { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 this.guid, this.getPropertiesCallback_.bind(this)); | 260 this.guid, this.getPropertiesCallback_.bind(this)); |
261 } | 261 } |
262 }, | 262 }, |
263 | 263 |
264 /** | 264 /** |
265 * networkingPrivate.getProperties callback. | 265 * networkingPrivate.getProperties callback. |
266 * @param {CrOnc.NetworkProperties} properties The network properties. | 266 * @param {CrOnc.NetworkProperties} properties The network properties. |
267 * @private | 267 * @private |
268 */ | 268 */ |
269 getPropertiesCallback_: function(properties) { | 269 getPropertiesCallback_: function(properties) { |
| 270 if (chrome.runtime.lastError) { |
| 271 var message = chrome.runtime.lastError.message; |
| 272 if (message == 'Error.InvalidNetworkGuid') { |
| 273 console.error('Details page: GUID no longer exists: ' + this.guid); |
| 274 } else { |
| 275 console.error( |
| 276 'Unexpected networkingPrivate.getManagedProperties error: ' + |
| 277 message + ' For: ' + this.guid); |
| 278 } |
| 279 this.close_(); |
| 280 return; |
| 281 } |
| 282 if (!properties) { |
| 283 console.error('No properties for: ' + this.guid); |
| 284 this.close_(); |
| 285 return; |
| 286 } |
270 this.networkProperties = properties; | 287 this.networkProperties = properties; |
271 if (!properties) { | |
272 // If |properties| is null, the network is no longer visible, close this. | |
273 console.error('Network no longer exists: ' + this.guid); | |
274 this.close_(); | |
275 } | |
276 }, | 288 }, |
277 | 289 |
278 /** | 290 /** |
279 * networkingPrivate.getState callback. | 291 * networkingPrivate.getState callback. |
280 * @param {CrOnc.NetworkStateProperties} state The network state properties. | 292 * @param {CrOnc.NetworkStateProperties} state The network state properties. |
281 * @private | 293 * @private |
282 */ | 294 */ |
283 getStateCallback_: function(state) { | 295 getStateCallback_: function(state) { |
284 if (!state) { | 296 if (!state) { |
285 // If |state| is null, the network is no longer visible, close this. | 297 // If |state| is null, the network is no longer visible, close this. |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 */ | 937 */ |
926 allPropertiesMatch_: function(curValue, newValue) { | 938 allPropertiesMatch_: function(curValue, newValue) { |
927 for (var key in newValue) { | 939 for (var key in newValue) { |
928 if (newValue[key] != curValue[key]) | 940 if (newValue[key] != curValue[key]) |
929 return false; | 941 return false; |
930 } | 942 } |
931 return true; | 943 return true; |
932 } | 944 } |
933 }); | 945 }); |
934 })(); | 946 })(); |
OLD | NEW |