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_ |