| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/android/feedback/screenshot_task.h" | 5 #include "chrome/browser/android/feedback/screenshot_task.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/memory/ref_counted_memory.h" | 11 #include "base/memory/ref_counted_memory.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "jni/ScreenshotTask_jni.h" | 13 #include "jni/ScreenshotTask_jni.h" |
| 14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
| 15 #include "ui/android/window_android.h" | 15 #include "ui/android/window_android.h" |
| 16 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
| 17 #include "ui/snapshot/snapshot.h" | 17 #include "ui/snapshot/snapshot.h" |
| 18 | 18 |
| 19 using base::android::AttachCurrentThread; | 19 using base::android::AttachCurrentThread; |
| 20 using base::android::JavaParamRef; |
| 20 using base::android::ScopedJavaGlobalRef; | 21 using base::android::ScopedJavaGlobalRef; |
| 21 using ui::WindowAndroid; | 22 using ui::WindowAndroid; |
| 22 | 23 |
| 23 namespace chrome { | 24 namespace chrome { |
| 24 namespace android { | 25 namespace android { |
| 25 | 26 |
| 26 bool RegisterScreenshotTask(JNIEnv* env) { | 27 bool RegisterScreenshotTask(JNIEnv* env) { |
| 27 return RegisterNativesImpl(env); | 28 return RegisterNativesImpl(env); |
| 28 } | 29 } |
| 29 | 30 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 window_bounds, | 56 window_bounds, |
| 56 base::ThreadTaskRunnerHandle::Get(), | 57 base::ThreadTaskRunnerHandle::Get(), |
| 57 base::Bind(&SnapshotCallback, | 58 base::Bind(&SnapshotCallback, |
| 58 env, | 59 env, |
| 59 base::Owned(new ScopedJavaGlobalRef<jobject>(env, | 60 base::Owned(new ScopedJavaGlobalRef<jobject>(env, |
| 60 jcallback)))); | 61 jcallback)))); |
| 61 } | 62 } |
| 62 | 63 |
| 63 } // namespace android | 64 } // namespace android |
| 64 } // namespace chrome | 65 } // namespace chrome |
| OLD | NEW |