| 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 */ | 8 */ |
| 9 WebInspector.DevicesSettingsTab = function() | 9 WebInspector.DevicesSettingsTab = function() |
| 10 { | 10 { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 return; | 273 return; |
| 274 | 274 |
| 275 this._editDevice.setShow(this._editDeviceCheckbox.checked); | 275 this._editDevice.setShow(this._editDeviceCheckbox.checked); |
| 276 this._editDevice.title = this._editDeviceTitle.value; | 276 this._editDevice.title = this._editDeviceTitle.value; |
| 277 this._editDevice.vertical.width = this._editDeviceWidth.value ? parseInt
(this._editDeviceWidth.value, 10) : 0; | 277 this._editDevice.vertical.width = this._editDeviceWidth.value ? parseInt
(this._editDeviceWidth.value, 10) : 0; |
| 278 this._editDevice.vertical.height = this._editDeviceHeight.value ? parseI
nt(this._editDeviceHeight.value, 10) : 0; | 278 this._editDevice.vertical.height = this._editDeviceHeight.value ? parseI
nt(this._editDeviceHeight.value, 10) : 0; |
| 279 this._editDevice.horizontal.width = this._editDevice.vertical.height; | 279 this._editDevice.horizontal.width = this._editDevice.vertical.height; |
| 280 this._editDevice.horizontal.height = this._editDevice.vertical.width; | 280 this._editDevice.horizontal.height = this._editDevice.vertical.width; |
| 281 this._editDevice.deviceScaleFactor = this._editDeviceScale.value ? parse
Float(this._editDeviceScale.value) : 0; | 281 this._editDevice.deviceScaleFactor = this._editDeviceScale.value ? parse
Float(this._editDeviceScale.value) : 0; |
| 282 this._editDevice.userAgent = this._editDeviceUserAgent.value; | 282 this._editDevice.userAgent = this._editDeviceUserAgent.value; |
| 283 this._editDevice.createImplicitModes(); |
| 283 | 284 |
| 284 this._stopEditing(); | 285 this._stopEditing(); |
| 285 if (this._editDeviceListItem) | 286 if (this._editDeviceListItem) |
| 286 WebInspector.emulatedDevicesList.saveCustomDevices(); | 287 WebInspector.emulatedDevicesList.saveCustomDevices(); |
| 287 else | 288 else |
| 288 WebInspector.emulatedDevicesList.addCustomDevice(this._editDevice); | 289 WebInspector.emulatedDevicesList.addCustomDevice(this._editDevice); |
| 289 this._editDevice = null; | 290 this._editDevice = null; |
| 290 this._editDeviceListItem = null; | 291 this._editDeviceListItem = null; |
| 291 }, | 292 }, |
| 292 | 293 |
| 293 _stopEditing: function() | 294 _stopEditing: function() |
| 294 { | 295 { |
| 295 this._devicesList.classList.remove("devices-list-editing"); | 296 this._devicesList.classList.remove("devices-list-editing"); |
| 296 if (this._editDeviceListItem) | 297 if (this._editDeviceListItem) |
| 297 this._editDeviceListItem.classList.remove("hidden"); | 298 this._editDeviceListItem.classList.remove("hidden"); |
| 298 if (this._editDeviceElement.parentElement) | 299 if (this._editDeviceElement.parentElement) |
| 299 this._devicesList.removeChild(this._editDeviceElement); | 300 this._devicesList.removeChild(this._editDeviceElement); |
| 300 this._addCustomButton.disabled = false; | 301 this._addCustomButton.disabled = false; |
| 301 this._addCustomButton.focus(); | 302 this._addCustomButton.focus(); |
| 302 }, | 303 }, |
| 303 | 304 |
| 304 __proto__: WebInspector.VBox.prototype | 305 __proto__: WebInspector.VBox.prototype |
| 305 } | 306 } |
| OLD | NEW |