| 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 * @implements {UI.ListWidget.Delegate} | 5 * @implements {UI.ListWidget.Delegate} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Emulation.DevicesSettingsTab = class extends UI.VBox { | 8 Emulation.DevicesSettingsTab = class extends UI.VBox { |
| 9 constructor() { | 9 constructor() { |
| 10 super(); | 10 super(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 var device = /** @type {!Emulation.EmulatedDevice} */ (item); | 141 var device = /** @type {!Emulation.EmulatedDevice} */ (item); |
| 142 device.title = editor.control('title').value.trim(); | 142 device.title = editor.control('title').value.trim(); |
| 143 device.vertical.width = editor.control('width').value ? parseInt(editor.cont
rol('width').value, 10) : 0; | 143 device.vertical.width = editor.control('width').value ? parseInt(editor.cont
rol('width').value, 10) : 0; |
| 144 device.vertical.height = editor.control('height').value ? parseInt(editor.co
ntrol('height').value, 10) : 0; | 144 device.vertical.height = editor.control('height').value ? parseInt(editor.co
ntrol('height').value, 10) : 0; |
| 145 device.horizontal.width = device.vertical.height; | 145 device.horizontal.width = device.vertical.height; |
| 146 device.horizontal.height = device.vertical.width; | 146 device.horizontal.height = device.vertical.width; |
| 147 device.deviceScaleFactor = editor.control('scale').value ? parseFloat(editor
.control('scale').value) : 0; | 147 device.deviceScaleFactor = editor.control('scale').value ? parseFloat(editor
.control('scale').value) : 0; |
| 148 device.userAgent = editor.control('user-agent').value; | 148 device.userAgent = editor.control('user-agent').value; |
| 149 device.modes = []; | 149 device.modes = []; |
| 150 device.modes.push( | 150 device.modes.push( |
| 151 {title: '', orientation: Emulation.EmulatedDevice.Vertical, insets: new
Insets(0, 0, 0, 0), image: null}); | 151 {title: '', orientation: Emulation.EmulatedDevice.Vertical, insets: new
UI.Insets(0, 0, 0, 0), image: null}); |
| 152 device.modes.push( | 152 device.modes.push( |
| 153 {title: '', orientation: Emulation.EmulatedDevice.Horizontal, insets: ne
w Insets(0, 0, 0, 0), image: null}); | 153 {title: '', orientation: Emulation.EmulatedDevice.Horizontal, insets: ne
w UI.Insets(0, 0, 0, 0), image: null}); |
| 154 device.capabilities = []; | 154 device.capabilities = []; |
| 155 var uaType = editor.control('ua-type').value; | 155 var uaType = editor.control('ua-type').value; |
| 156 if (uaType === Emulation.DeviceModeModel.UA.Mobile || uaType === Emulation.D
eviceModeModel.UA.MobileNoTouch) | 156 if (uaType === Emulation.DeviceModeModel.UA.Mobile || uaType === Emulation.D
eviceModeModel.UA.MobileNoTouch) |
| 157 device.capabilities.push(Emulation.EmulatedDevice.Capability.Mobile); | 157 device.capabilities.push(Emulation.EmulatedDevice.Capability.Mobile); |
| 158 if (uaType === Emulation.DeviceModeModel.UA.Mobile || uaType === Emulation.D
eviceModeModel.UA.DesktopTouch) | 158 if (uaType === Emulation.DeviceModeModel.UA.Mobile || uaType === Emulation.D
eviceModeModel.UA.DesktopTouch) |
| 159 device.capabilities.push(Emulation.EmulatedDevice.Capability.Touch); | 159 device.capabilities.push(Emulation.EmulatedDevice.Capability.Touch); |
| 160 if (isNew) | 160 if (isNew) |
| 161 this._emulatedDevicesList.addCustomDevice(device); | 161 this._emulatedDevicesList.addCustomDevice(device); |
| 162 else | 162 else |
| 163 this._emulatedDevicesList.saveCustomDevices(); | 163 this._emulatedDevicesList.saveCustomDevices(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 * @param {*} item | 246 * @param {*} item |
| 247 * @param {number} index | 247 * @param {number} index |
| 248 * @param {!HTMLInputElement|!HTMLSelectElement} input | 248 * @param {!HTMLInputElement|!HTMLSelectElement} input |
| 249 * @return {boolean} | 249 * @return {boolean} |
| 250 */ | 250 */ |
| 251 function scaleValidator(item, index, input) { | 251 function scaleValidator(item, index, input) { |
| 252 return Emulation.DeviceModeModel.deviceScaleFactorValidator(input.value); | 252 return Emulation.DeviceModeModel.deviceScaleFactorValidator(input.value); |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 }; | 255 }; |
| OLD | NEW |