| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @constructor | 6 * @constructor |
| 7 */ | 7 */ |
| 8 WebInspector.EmulatedDevice = function() | 8 WebInspector.EmulatedDevice = function() |
| 9 { | 9 { |
| 10 /** @type {string} */ | 10 /** @type {string} */ |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 this._updateStandardDevices(); | 388 this._updateStandardDevices(); |
| 389 | 389 |
| 390 /** @type {!WebInspector.Setting} */ | 390 /** @type {!WebInspector.Setting} */ |
| 391 this._customSetting = WebInspector.settings.createSetting("customEmulatedDev
iceList", []); | 391 this._customSetting = WebInspector.settings.createSetting("customEmulatedDev
iceList", []); |
| 392 /** @type {!Array.<!WebInspector.EmulatedDevice>} */ | 392 /** @type {!Array.<!WebInspector.EmulatedDevice>} */ |
| 393 this._custom = []; | 393 this._custom = []; |
| 394 if (!this._listFromJSONV1(this._customSetting.get(), this._custom)) | 394 if (!this._listFromJSONV1(this._customSetting.get(), this._custom)) |
| 395 this.saveCustomDevices(); | 395 this.saveCustomDevices(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 /** @enum {symbol} */ |
| 398 WebInspector.EmulatedDevicesList.Events = { | 399 WebInspector.EmulatedDevicesList.Events = { |
| 399 CustomDevicesUpdated: "CustomDevicesUpdated", | 400 CustomDevicesUpdated: Symbol("CustomDevicesUpdated"), |
| 400 StandardDevicesUpdated: "StandardDevicesUpdated" | 401 StandardDevicesUpdated: Symbol("StandardDevicesUpdated") |
| 401 } | 402 } |
| 402 | 403 |
| 403 WebInspector.EmulatedDevicesList.prototype = { | 404 WebInspector.EmulatedDevicesList.prototype = { |
| 404 _updateStandardDevices: function() | 405 _updateStandardDevices: function() |
| 405 { | 406 { |
| 406 var devices = []; | 407 var devices = []; |
| 407 var extensions = self.runtime.extensions("emulated-device"); | 408 var extensions = self.runtime.extensions("emulated-device"); |
| 408 for (var i = 0; i < extensions.length; ++i) { | 409 for (var i = 0; i < extensions.length; ++i) { |
| 409 var device = WebInspector.EmulatedDevice.fromJSONV1(extensions[i].de
scriptor()["device"]); | 410 var device = WebInspector.EmulatedDevice.fromJSONV1(extensions[i].de
scriptor()["device"]); |
| 410 device.setExtension(extensions[i]); | 411 device.setExtension(extensions[i]); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 519 |
| 519 /** | 520 /** |
| 520 * @return {!WebInspector.EmulatedDevicesList} | 521 * @return {!WebInspector.EmulatedDevicesList} |
| 521 */ | 522 */ |
| 522 WebInspector.EmulatedDevicesList.instance = function() | 523 WebInspector.EmulatedDevicesList.instance = function() |
| 523 { | 524 { |
| 524 if (!WebInspector.EmulatedDevicesList._instance) | 525 if (!WebInspector.EmulatedDevicesList._instance) |
| 525 WebInspector.EmulatedDevicesList._instance = new WebInspector.EmulatedDe
vicesList(); | 526 WebInspector.EmulatedDevicesList._instance = new WebInspector.EmulatedDe
vicesList(); |
| 526 return /** @type {!WebInspector.EmulatedDevicesList} */ (WebInspector.Emulat
edDevicesList._instance); | 527 return /** @type {!WebInspector.EmulatedDevicesList} */ (WebInspector.Emulat
edDevicesList._instance); |
| 527 } | 528 } |
| OLD | NEW |