OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 __proto__: WebInspector.OverridesView.Tab.prototype | 432 __proto__: WebInspector.OverridesView.Tab.prototype |
433 } | 433 } |
434 | 434 |
435 | 435 |
436 /** | 436 /** |
437 * @constructor | 437 * @constructor |
438 * @extends {WebInspector.OverridesView.Tab} | 438 * @extends {WebInspector.OverridesView.Tab} |
439 */ | 439 */ |
440 WebInspector.OverridesView.SensorsTab = function() | 440 WebInspector.OverridesView.SensorsTab = function() |
441 { | 441 { |
442 var settings = [WebInspector.overridesSupport.settings.overrideGeolocation,
WebInspector.overridesSupport.settings.overrideDeviceOrientation]; | 442 WebInspector.OverridesView.Tab.call(this, "sensors", WebInspector.UIString("
Sensors"), [ |
443 if (!WebInspector.overridesSupport.hasTouchInputs()) | 443 WebInspector.overridesSupport.settings.overrideGeolocation, |
444 settings.push(WebInspector.overridesSupport.settings.emulateTouch); | 444 WebInspector.overridesSupport.settings.overrideDeviceOrientation, |
445 WebInspector.OverridesView.Tab.call(this, "sensors", WebInspector.UIString("
Sensors"), settings); | 445 WebInspector.overridesSupport.settings.emulateTouch |
| 446 ]); |
446 | 447 |
447 this.element.classList.add("overrides-sensors"); | 448 this.element.classList.add("overrides-sensors"); |
448 this.registerRequiredCSS("accelerometer.css"); | 449 this.registerRequiredCSS("accelerometer.css"); |
449 if (!WebInspector.overridesSupport.hasTouchInputs()) | 450 this.element.appendChild(this._createSettingCheckbox(WebInspector.UIString("
Emulate touch screen"), WebInspector.overridesSupport.settings.emulateTouch, und
efined)); |
450 this.element.appendChild(this._createSettingCheckbox(WebInspector.UIStri
ng("Emulate touch screen"), WebInspector.overridesSupport.settings.emulateTouch,
undefined)); | |
451 this._appendGeolocationOverrideControl(); | 451 this._appendGeolocationOverrideControl(); |
452 this._apendDeviceOrientationOverrideControl(); | 452 this._apendDeviceOrientationOverrideControl(); |
453 } | 453 } |
454 | 454 |
455 WebInspector.OverridesView.SensorsTab.prototype = { | 455 WebInspector.OverridesView.SensorsTab.prototype = { |
456 _appendGeolocationOverrideControl: function() | 456 _appendGeolocationOverrideControl: function() |
457 { | 457 { |
458 const geolocationSetting = WebInspector.overridesSupport.settings.geoloc
ationOverride.get(); | 458 const geolocationSetting = WebInspector.overridesSupport.settings.geoloc
ationOverride.get(); |
459 var geolocation = WebInspector.OverridesSupport.GeolocationPosition.pars
eSetting(geolocationSetting); | 459 var geolocation = WebInspector.OverridesSupport.GeolocationPosition.pars
eSetting(geolocationSetting); |
460 this.element.appendChild(this._createSettingCheckbox(WebInspector.UIStri
ng("Emulate geolocation coordinates"), WebInspector.overridesSupport.settings.ov
errideGeolocation, this._geolocationOverrideCheckboxClicked.bind(this))); | 460 this.element.appendChild(this._createSettingCheckbox(WebInspector.UIStri
ng("Emulate geolocation coordinates"), WebInspector.overridesSupport.settings.ov
errideGeolocation, this._geolocationOverrideCheckboxClicked.bind(this))); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 | 721 |
722 WebInspector.OverridesView.Revealer.prototype = { | 722 WebInspector.OverridesView.Revealer.prototype = { |
723 /** | 723 /** |
724 * @param {!Object} overridesSupport | 724 * @param {!Object} overridesSupport |
725 */ | 725 */ |
726 reveal: function(overridesSupport) | 726 reveal: function(overridesSupport) |
727 { | 727 { |
728 WebInspector.inspectorView.showViewInDrawer("emulation"); | 728 WebInspector.inspectorView.showViewInDrawer("emulation"); |
729 } | 729 } |
730 } | 730 } |
OLD | NEW |