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(); |
11 this.element.classList.add('settings-tab-container'); | 11 this.element.classList.add('settings-tab-container'); |
12 this.element.classList.add('devices-settings-tab'); | 12 this.element.classList.add('devices-settings-tab'); |
13 this.registerRequiredCSS('emulation/devicesSettingsTab.css'); | 13 this.registerRequiredCSS('emulation/devicesSettingsTab.css'); |
14 | 14 |
15 var header = this.element.createChild('header'); | 15 var header = this.element.createChild('header'); |
16 header.createChild('h3').createTextChild(Common.UIString('Emulated Devices')
); | 16 header.createChild('h3').createTextChild(Common.UIString('Emulated Devices')
); |
17 this.containerElement = this.element.createChild('div', 'help-container-wrap
per') | 17 this.containerElement = this.element.createChild('div', 'help-container-wrap
per') |
18 .createChild('div', 'settings-tab help-content h
elp-container'); | 18 .createChild('div', 'settings-tab help-content h
elp-container'); |
19 | 19 |
20 var buttonsRow = this.containerElement.createChild('div', 'devices-button-ro
w'); | 20 var buttonsRow = this.containerElement.createChild('div', 'devices-button-ro
w'); |
21 this._addCustomButton = createTextButton(Common.UIString('Add custom device.
..'), this._addCustomDevice.bind(this)); | 21 this._addCustomButton = |
| 22 UI.createTextButton(Common.UIString('Add custom device...'), this._addCu
stomDevice.bind(this)); |
22 buttonsRow.appendChild(this._addCustomButton); | 23 buttonsRow.appendChild(this._addCustomButton); |
23 | 24 |
24 this._list = new UI.ListWidget(this); | 25 this._list = new UI.ListWidget(this); |
25 this._list.registerRequiredCSS('emulation/devicesSettingsTab.css'); | 26 this._list.registerRequiredCSS('emulation/devicesSettingsTab.css'); |
26 this._list.element.classList.add('devices-list'); | 27 this._list.element.classList.add('devices-list'); |
27 this._list.show(this.containerElement); | 28 this._list.show(this.containerElement); |
28 | 29 |
29 this._muteUpdate = false; | 30 this._muteUpdate = false; |
30 this._emulatedDevicesList = Emulation.EmulatedDevicesList.instance(); | 31 this._emulatedDevicesList = Emulation.EmulatedDevicesList.instance(); |
31 this._emulatedDevicesList.addEventListener( | 32 this._emulatedDevicesList.addEventListener( |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 * @param {*} item | 246 * @param {*} item |
246 * @param {number} index | 247 * @param {number} index |
247 * @param {!HTMLInputElement|!HTMLSelectElement} input | 248 * @param {!HTMLInputElement|!HTMLSelectElement} input |
248 * @return {boolean} | 249 * @return {boolean} |
249 */ | 250 */ |
250 function scaleValidator(item, index, input) { | 251 function scaleValidator(item, index, input) { |
251 return Emulation.DeviceModeModel.deviceScaleFactorValidator(input.value); | 252 return Emulation.DeviceModeModel.deviceScaleFactorValidator(input.value); |
252 } | 253 } |
253 } | 254 } |
254 }; | 255 }; |
OLD | NEW |