| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 Emulation.DeviceModeView = class extends UI.VBox { | 7 Emulation.DeviceModeView = class extends UI.VBox { |
| 8 constructor() { | 8 constructor() { |
| 9 super(true); | 9 super(true); |
| 10 this.setMinimumSize(150, 150); | 10 this.setMinimumSize(150, 150); |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 var rect = this._contentArea.getBoundingClientRect(); | 372 var rect = this._contentArea.getBoundingClientRect(); |
| 373 var availableSize = new UI.Size(Math.max(rect.width * zoomFactor, 1), Math.m
ax(rect.height * zoomFactor, 1)); | 373 var availableSize = new UI.Size(Math.max(rect.width * zoomFactor, 1), Math.m
ax(rect.height * zoomFactor, 1)); |
| 374 var outlineVisible = this._model.deviceOutlineSetting().get(); | 374 var outlineVisible = this._model.deviceOutlineSetting().get(); |
| 375 | 375 |
| 376 if (availableSize.width < this._model.screenRect().width || | 376 if (availableSize.width < this._model.screenRect().width || |
| 377 availableSize.height < this._model.screenRect().height) { | 377 availableSize.height < this._model.screenRect().height) { |
| 378 UI.inspectorView.minimize(); | 378 UI.inspectorView.minimize(); |
| 379 this._model.deviceOutlineSetting().set(false); | 379 this._model.deviceOutlineSetting().set(false); |
| 380 } | 380 } |
| 381 | 381 |
| 382 screenCaptureModel.captureScreenshot('png', 100).then(screenshotCaptured.bin
d(this)); | 382 screenCaptureModel.captureScreenshot('png', 100, false).then(screenshotCaptu
red.bind(this)); |
| 383 | 383 |
| 384 /** | 384 /** |
| 385 * @param {?string} content | 385 * @param {?string} content |
| 386 * @this {Emulation.DeviceModeView} | 386 * @this {Emulation.DeviceModeView} |
| 387 */ | 387 */ |
| 388 function screenshotCaptured(content) { | 388 function screenshotCaptured(content) { |
| 389 this._model.deviceOutlineSetting().set(outlineVisible); | 389 this._model.deviceOutlineSetting().set(outlineVisible); |
| 390 var dpr = window.devicePixelRatio; | 390 var dpr = window.devicePixelRatio; |
| 391 var outlineRect = this._model.outlineRect().scale(dpr); | 391 var outlineRect = this._model.outlineRect().scale(dpr); |
| 392 var screenRect = this._model.screenRect().scale(dpr); | 392 var screenRect = this._model.screenRect().scale(dpr); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 return Promise.resolve(); | 594 return Promise.resolve(); |
| 595 } | 595 } |
| 596 | 596 |
| 597 /** | 597 /** |
| 598 * @param {number} size | 598 * @param {number} size |
| 599 */ | 599 */ |
| 600 _onMarkerClick(size) { | 600 _onMarkerClick(size) { |
| 601 this._applyCallback.call(null, size); | 601 this._applyCallback.call(null, size); |
| 602 } | 602 } |
| 603 }; | 603 }; |
| OLD | NEW |