1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_READBACK_HANDLER_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_READBACK_HANDLER_H_
10 #include "base/android/jni_weak_ref.h"
11 #include "base/callback.h"
12 #include "base/memory/weak_ptr.h"
17 class CopyOutputResult
;
22 // Native side of the ContentReadbackHandler.java, which issues content
23 // readbacks from the Java side.
24 class ContentReadbackHandler
{
26 // Registers the JNI methods for ContentViewRender.
27 static bool RegisterContentReadbackHandler(JNIEnv
* env
);
29 // Methods called from Java via JNI -----------------------------------------
30 ContentReadbackHandler(JNIEnv
* env
, jobject obj
);
31 void Destroy(JNIEnv
* env
, jobject obj
);
32 void GetContentBitmap(JNIEnv
* env
,
41 jobject content_view_core
);
42 void GetCompositorBitmap(JNIEnv
* env
,
45 jlong native_window_android
);
48 virtual ~ContentReadbackHandler();
50 void OnFinishReadback(int readback_id
,
52 const SkBitmap
& bitmap
);
54 base::android::ScopedJavaGlobalRef
<jobject
> java_obj_
;
55 base::WeakPtrFactory
<ContentReadbackHandler
> weak_factory_
;
57 DISALLOW_COPY_AND_ASSIGN(ContentReadbackHandler
);
60 } // namespace content
62 #endif // CONTENT_BROWSER_ANDROID_CONTENT_READBACK_HANDLER_H_