Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js

Issue 2261933002: DevTools: Use JS symbols instead of strings for eligible events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698