OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/android/content_readback_handler.h" | 5 #include "content/browser/android/content_readback_handler.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 JNIEnv* env = base::android::AttachCurrentThread(); | 108 JNIEnv* env = base::android::AttachCurrentThread(); |
109 ScopedJavaLocalRef<jobject> java_bitmap; | 109 ScopedJavaLocalRef<jobject> java_bitmap; |
110 if (response == READBACK_SUCCESS) | 110 if (response == READBACK_SUCCESS) |
111 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); | 111 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); |
112 | 112 |
113 Java_ContentReadbackHandler_notifyGetBitmapFinished( | 113 Java_ContentReadbackHandler_notifyGetBitmapFinished( |
114 env, java_obj_.obj(), readback_id, java_bitmap.obj(), response); | 114 env, java_obj_.obj(), readback_id, java_bitmap.obj(), response); |
115 } | 115 } |
116 | 116 |
117 // static | 117 // static |
118 static jlong Init(JNIEnv* env, jobject obj) { | 118 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
119 ContentReadbackHandler* content_readback_handler = | 119 ContentReadbackHandler* content_readback_handler = |
120 new ContentReadbackHandler(env, obj); | 120 new ContentReadbackHandler(env, obj); |
121 return reinterpret_cast<intptr_t>(content_readback_handler); | 121 return reinterpret_cast<intptr_t>(content_readback_handler); |
122 } | 122 } |
123 | 123 |
124 } // namespace content | 124 } // namespace content |
OLD | NEW |