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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ScreenCaptureModel.js

Issue 2732923002: Add fromSurface optional parameter to devtools Page.CaptureScreenshot (Closed)
Patch Set: nits Created 3 years, 9 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 * @implements {Protocol.PageDispatcher} 6 * @implements {Protocol.PageDispatcher}
7 */ 7 */
8 SDK.ScreenCaptureModel = class extends SDK.SDKModel { 8 SDK.ScreenCaptureModel = class extends SDK.SDKModel {
9 /** 9 /**
10 * @param {!SDK.Target} target 10 * @param {!SDK.Target} target
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 /** 43 /**
44 * @param {string} format 44 * @param {string} format
45 * @param {number} quality 45 * @param {number} quality
46 * @return {!Promise<?string>} 46 * @return {!Promise<?string>}
47 */ 47 */
48 captureScreenshot(format, quality) { 48 captureScreenshot(format, quality) {
49 var fulfill; 49 var fulfill;
50 var promise = new Promise(callback => fulfill = callback); 50 var promise = new Promise(callback => fulfill = callback);
51 this._agent.captureScreenshot(format, quality, (error, content) => { 51 this._agent.captureScreenshot(format, quality, false, (error, content) => {
52 if (error) 52 if (error)
53 console.error(error); 53 console.error(error);
54 fulfill(error ? null : content); 54 fulfill(error ? null : content);
55 }); 55 });
56 return promise; 56 return promise;
57 } 57 }
58 58
59 /** 59 /**
60 * @return {!Promise<?{width: number, height: number}>} 60 * @return {!Promise<?{width: number, height: number}>}
61 */ 61 */
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 /** 197 /**
198 * @override 198 * @override
199 */ 199 */
200 navigationRequested() { 200 navigationRequested() {
201 } 201 }
202 }; 202 };
203 203
204 SDK.SDKModel.register(SDK.ScreenCaptureModel, SDK.Target.Capability.ScreenCaptur e); 204 SDK.SDKModel.register(SDK.ScreenCaptureModel, SDK.Target.Capability.ScreenCaptur e);
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698