From 8e2fdc178b354ff913acabaa973eaa29bdb81519 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 Mar 2015 16:39:20 -0700 Subject: [PATCH] Fix API changes of CopyFromBackingStore --- atom/browser/native_window.cc | 6 +++--- atom/browser/native_window.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 1ecb2646fe..d8b221eb51 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -780,11 +780,11 @@ void NativeWindow::NotifyWindowUnresponsive() { } void NativeWindow::OnCapturePageDone(const CapturePageCallback& callback, - bool succeed, - const SkBitmap& bitmap) { + const SkBitmap& bitmap, + content::ReadbackResponse response) { SkAutoLockPixels screen_capture_lock(bitmap); std::vector data; - if (succeed) + if (response == content::READBACK_SUCCESS) gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &data); callback.Run(data); } diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index e0f8f9d29a..f9a7a85634 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -20,6 +20,7 @@ #include "brightray/browser/inspectable_web_contents_impl.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_observer.h" +#include "content/public/browser/readback_types.h" #include "native_mate/persistent_dictionary.h" #include "ui/gfx/image/image.h" @@ -316,8 +317,8 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, // Called when CapturePage has done. void OnCapturePageDone(const CapturePageCallback& callback, - bool succeed, - const SkBitmap& bitmap); + const SkBitmap& bitmap, + content::ReadbackResponse response); // Notification manager. content::NotificationRegistrar registrar_;