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

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

Issue 390933003: android: Fix parameter for onFinishGetBitmap in ContentReadbackHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 6 years, 4 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
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 void ContentReadbackHandler::OnFinishReadback(int readback_id, 107 void ContentReadbackHandler::OnFinishReadback(int readback_id,
108 bool success, 108 bool success,
109 const SkBitmap& bitmap) { 109 const SkBitmap& bitmap) {
110 JNIEnv* env = base::android::AttachCurrentThread(); 110 JNIEnv* env = base::android::AttachCurrentThread();
111 ScopedJavaLocalRef<jobject> java_bitmap; 111 ScopedJavaLocalRef<jobject> java_bitmap;
112 if (success) 112 if (success)
113 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); 113 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap);
114 114
115 Java_ContentReadbackHandler_notifyGetBitmapFinished( 115 Java_ContentReadbackHandler_notifyGetBitmapFinished(
116 env, java_obj_.obj(), readback_id, success, java_bitmap.obj()); 116 env, java_obj_.obj(), readback_id, java_bitmap.obj());
117 } 117 }
118 118
119 // static 119 // static
120 static jlong Init(JNIEnv* env, jobject obj) { 120 static jlong Init(JNIEnv* env, jobject obj) {
121 ContentReadbackHandler* content_readback_handler = 121 ContentReadbackHandler* content_readback_handler =
122 new ContentReadbackHandler(env, obj); 122 new ContentReadbackHandler(env, obj);
123 return reinterpret_cast<intptr_t>(content_readback_handler); 123 return reinterpret_cast<intptr_t>(content_readback_handler);
124 } 124 }
125 125
126 } // namespace content 126 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698