| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_SNAPSHOT_SNAPSHOT_H_ | 5 #ifndef UI_SNAPSHOT_SNAPSHOT_H_ |
| 6 #define UI_SNAPSHOT_SNAPSHOT_H_ | 6 #define UI_SNAPSHOT_SNAPSHOT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/ref_counted_memory.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/snapshot/snapshot_export.h" | 14 #include "ui/snapshot/snapshot_export.h" |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class TaskRunner; | 17 class TaskRunner; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class Rect; | 21 class Rect; |
| 21 class Image; | 22 class Image; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 typedef base::Callback<void(const gfx::Image& snapshot)> | 43 typedef base::Callback<void(const gfx::Image& snapshot)> |
| 43 GrabWindowSnapshotAsyncCallback; | 44 GrabWindowSnapshotAsyncCallback; |
| 44 // GrabWindowSnapshotAndScaleAsync() copies snapshot of |source_rect| from | 45 // GrabWindowSnapshotAndScaleAsync() copies snapshot of |source_rect| from |
| 45 // window and scales it to |target_size| asynchronously. | 46 // window and scales it to |target_size| asynchronously. |
| 46 SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsync( | 47 SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsync( |
| 47 gfx::NativeWindow window, | 48 gfx::NativeWindow window, |
| 48 const gfx::Rect& source_rect, | 49 const gfx::Rect& source_rect, |
| 49 const gfx::Size& target_size, | 50 const gfx::Size& target_size, |
| 50 scoped_refptr<base::TaskRunner> background_task_runner, | 51 scoped_refptr<base::TaskRunner> background_task_runner, |
| 51 const GrabWindowSnapshotAsyncCallback& callback); | 52 const GrabWindowSnapshotAsyncCallback& callback); |
| 53 |
| 54 typedef base::Callback<void(scoped_refptr<base::RefCountedBytes> png_data)> |
| 55 GrabWindowSnapshotAsyncPNGCallback; |
| 52 SNAPSHOT_EXPORT void GrabWindowSnapshotAsync( | 56 SNAPSHOT_EXPORT void GrabWindowSnapshotAsync( |
| 53 gfx::NativeWindow window, | 57 gfx::NativeWindow window, |
| 54 const gfx::Rect& source_rect, | 58 const gfx::Rect& source_rect, |
| 55 scoped_refptr<base::TaskRunner> background_task_runner, | 59 scoped_refptr<base::TaskRunner> background_task_runner, |
| 56 const GrabWindowSnapshotAsyncCallback& callback); | 60 const GrabWindowSnapshotAsyncPNGCallback& callback); |
| 57 | 61 |
| 58 } // namespace ui | 62 } // namespace ui |
| 59 | 63 |
| 60 #endif // UI_SNAPSHOT_SNAPSHOT_H_ | 64 #endif // UI_SNAPSHOT_SNAPSHOT_H_ |
| OLD | NEW |