Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js

Issue 2650903003: Revert of [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 var rect = this._contentArea.getBoundingClientRect(); 369 var rect = this._contentArea.getBoundingClientRect();
370 var availableSize = new UI.Size(Math.max(rect.width * zoomFactor, 1), Math.m ax(rect.height * zoomFactor, 1)); 370 var availableSize = new UI.Size(Math.max(rect.width * zoomFactor, 1), Math.m ax(rect.height * zoomFactor, 1));
371 var outlineVisible = this._model.deviceOutlineSetting().get(); 371 var outlineVisible = this._model.deviceOutlineSetting().get();
372 372
373 if (availableSize.width < this._model.screenRect().width || 373 if (availableSize.width < this._model.screenRect().width ||
374 availableSize.height < this._model.screenRect().height) { 374 availableSize.height < this._model.screenRect().height) {
375 UI.inspectorView.minimize(); 375 UI.inspectorView.minimize();
376 this._model.deviceOutlineSetting().set(false); 376 this._model.deviceOutlineSetting().set(false);
377 } 377 }
378 378
379 mainTarget.pageAgent().captureScreenshot('png', 100, screenshotCaptured.bind (this)); 379 mainTarget.pageAgent().captureScreenshot(screenshotCaptured.bind(this));
380 380
381 /** 381 /**
382 * @param {?Protocol.Error} error 382 * @param {?Protocol.Error} error
383 * @param {string} content 383 * @param {string} content
384 * @this {Emulation.DeviceModeView} 384 * @this {Emulation.DeviceModeView}
385 */ 385 */
386 function screenshotCaptured(error, content) { 386 function screenshotCaptured(error, content) {
387 this._model.deviceOutlineSetting().set(outlineVisible); 387 this._model.deviceOutlineSetting().set(outlineVisible);
388 var dpr = window.devicePixelRatio; 388 var dpr = window.devicePixelRatio;
389 var outlineRect = this._model.outlineRect().scale(dpr); 389 var outlineRect = this._model.outlineRect().scale(dpr);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 return Promise.resolve(); 565 return Promise.resolve();
566 } 566 }
567 567
568 /** 568 /**
569 * @param {number} size 569 * @param {number} size
570 */ 570 */
571 _onMarkerClick(size) { 571 _onMarkerClick(size) {
572 this._applyCallback.call(null, size); 572 this._applyCallback.call(null, size);
573 } 573 }
574 }; 574 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698