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

Unified Diff: content/browser/devtools/protocol/page_handler_image_utils.h

Issue 2592983002: [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: Return gfx::Image from ui snapshot methods instead. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/page_handler_image_utils.h
diff --git a/content/browser/devtools/protocol/page_handler_image_utils.h b/content/browser/devtools/protocol/page_handler_image_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf458efb0bfc729ca3d6312589c4cd3911996c8f
--- /dev/null
+++ b/content/browser/devtools/protocol/page_handler_image_utils.h
@@ -0,0 +1,27 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_IMAGE_UTILS_H_
+#define BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_IMAGE_UTILS_H_
+
+#include "base/macros.h"
+
+namespace content {
+namespace protocol {
+
+enum class ScreenshotFormat { PNG, JPEG };
+
+// base64-encodes the provided gfx::Image as PNG or JPEG.
+std::string EncodeScreenshotImage(const gfx::Image& image,
+ ScreenshotFormat format,
+ int quality);
+
+scoped_refptr<base::RefCountedMemory> EncodeScreenshotImageAsJpeg(
+ const gfx::Image& image,
+ int quality);
+
+} // namespace protocol
+} // namespace content
+
+#endif // BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_IMAGE_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698