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

Side by Side Diff: content/browser/android/content_readback_handler.cc

Issue 1040393002: The Java Client should be aware of the readback status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build errors Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/content.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 void ContentReadbackHandler::OnFinishReadback(int readback_id, 105 void ContentReadbackHandler::OnFinishReadback(int readback_id,
106 const SkBitmap& bitmap, 106 const SkBitmap& bitmap,
107 ReadbackResponse response) { 107 ReadbackResponse response) {
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()); 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, 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
OLDNEW
« no previous file with comments | « no previous file | content/content.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698