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

Unified Diff: extensions/browser/api/guest_view/web_view/web_view_internal_api.cc

Issue 1863953002: <webview>: Fix missing transparency in captureVisibleRegion(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build break Created 4 years, 8 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: extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
diff --git a/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc b/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
index 0b8d4afe4189b786f959568c532e1069c369ebe4..e33962dbe2e3d721a5ac5b4142ca903b004b2268 100644
--- a/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
+++ b/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
@@ -258,6 +258,10 @@ bool WebViewInternalExtensionFunction::RunAsync() {
return RunAsyncSafe(guest);
}
+WebViewInternalCaptureVisibleRegionFunction::
+ WebViewInternalCaptureVisibleRegionFunction()
+ : is_guest_transparent_(false) {}
+
bool WebViewInternalCaptureVisibleRegionFunction::RunAsyncSafe(
WebViewGuest* guest) {
using api::extension_types::ImageDetails;
@@ -273,6 +277,7 @@ bool WebViewInternalCaptureVisibleRegionFunction::RunAsyncSafe(
image_details = ImageDetails::FromValue(*spec);
}
+ is_guest_transparent_ = guest->allow_transparency();
return CaptureAsync(guest->web_contents(), image_details.get(),
base::Bind(&WebViewInternalCaptureVisibleRegionFunction::
CopyFromBackingStoreComplete,
@@ -283,6 +288,10 @@ bool WebViewInternalCaptureVisibleRegionFunction::IsScreenshotEnabled() {
return true;
}
+bool WebViewInternalCaptureVisibleRegionFunction::ClientAllowsTransparency() {
+ return is_guest_transparent_;
+}
+
void WebViewInternalCaptureVisibleRegionFunction::OnCaptureSuccess(
const SkBitmap& bitmap) {
std::string base64_result;

Powered by Google App Engine
This is Rietveld 408576698