Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @param {!WebInspector.DeviceModeModel} model | 6 * @param {!WebInspector.DeviceModeModel} model |
| 7 * @param {!WebInspector.Setting} showMediaInspectorSetting | 7 * @param {!WebInspector.Setting} showMediaInspectorSetting |
| 8 * @param {!WebInspector.Setting} showRulersSetting | 8 * @param {!WebInspector.Setting} showRulersSetting |
| 9 * @constructor | 9 * @constructor |
| 10 */ | 10 */ |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 for (var device of devices) | 394 for (var device of devices) |
| 395 contextMenu.appendCheckboxItem(device.title, this._emulateDevice .bind(this, device), this._model.device() === device, false); | 395 contextMenu.appendCheckboxItem(device.title, this._emulateDevice .bind(this, device), this._model.device() === device, false); |
| 396 } | 396 } |
| 397 }, | 397 }, |
| 398 | 398 |
| 399 /** | 399 /** |
| 400 * @this {WebInspector.DeviceModeToolbar} | 400 * @this {WebInspector.DeviceModeToolbar} |
| 401 */ | 401 */ |
| 402 _deviceListChanged: function() | 402 _deviceListChanged: function() |
| 403 { | 403 { |
| 404 if (!this._model.device()) | 404 var model = this._model.device(); |
|
lushnikov
2016/03/04 05:06:58
model => device
kozy
2016/03/04 06:13:29
Done.
| |
| 405 if (!model) | |
| 405 return; | 406 return; |
| 406 | 407 |
| 407 var devices = this._allDevices(); | 408 var devices = this._allDevices(); |
| 408 if (devices.indexOf(this._model.device()) === -1) { | 409 if (devices.indexOf(model) === -1) { |
| 409 if (devices.length) | 410 if (devices.length) |
| 410 this._emulateDevice(devices[0]); | 411 this._emulateDevice(devices[0]); |
| 411 else | 412 else |
| 412 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive , null, null); | 413 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive , null, null); |
| 413 } | 414 } |
| 414 }, | 415 }, |
| 415 | 416 |
| 416 _updateDeviceScaleFactorVisibility: function() | 417 _updateDeviceScaleFactorVisibility: function() |
| 417 { | 418 { |
| 418 this._deviceScaleItem.setVisible(this._showDeviceScaleFactorSetting.get( )); | 419 this._deviceScaleItem.setVisible(this._showDeviceScaleFactorSetting.get( )); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 this._emulateDevice(device); | 572 this._emulateDevice(device); |
| 572 return; | 573 return; |
| 573 } | 574 } |
| 574 } | 575 } |
| 575 } | 576 } |
| 576 } | 577 } |
| 577 | 578 |
| 578 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); | 579 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); |
| 579 } | 580 } |
| 580 } | 581 } |
| OLD | NEW |