]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix API changes of CopyFromBackingStore
authorCheng Zhao <zcbenz@gmail.com>
Tue, 10 Mar 2015 23:39:20 +0000 (16:39 -0700)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 18 Mar 2015 01:57:40 +0000 (09:57 +0800)
atom/browser/native_window.cc
atom/browser/native_window.h

index 1ecb2646fe4e2a98591db060c27cc3d6e0a9c360..d8b221eb5176219d61d0a2db53d53a38d5e093a2 100644 (file)
@@ -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<unsigned char> data;
-  if (succeed)
+  if (response == content::READBACK_SUCCESS)
     gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &data);
   callback.Run(data);
 }
index e0f8f9d29ad5095dace98af5877cd5d6c8ca5699..f9a7a85634232892c7a68529333af5d4ec00387e 100644 (file)
@@ -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_;