| 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 #ifndef UI_SNAPSHOT_SNAPSHOT_ASYNC_H_ | 5 #ifndef UI_SNAPSHOT_SNAPSHOT_ASYNC_H_ |
| 6 #define UI_SNAPSHOT_SNAPSHOT_ASYNC_H_ | 6 #define UI_SNAPSHOT_SNAPSHOT_ASYNC_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "cc/output/copy_output_result.h" | 11 #include "cc/output/copy_output_result.h" |
| 11 #include "ui/snapshot/snapshot.h" | 12 #include "ui/snapshot/snapshot.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class TaskRunner; | 15 class TaskRunner; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Size; | 19 class Size; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace ui { | 22 namespace ui { |
| 22 | 23 |
| 23 // Helper methods for async snapshots to convert a cc::CopyOutputResult into a | 24 // Helper methods for async snapshots to convert a cc::CopyOutputResult into a |
| 24 // ui::GrabWindowSnapshot callback. | 25 // ui::GrabWindowSnapshot callback. |
| 25 class SnapshotAsync { | 26 class SnapshotAsync { |
| 26 public: | 27 public: |
| 27 static void ScaleCopyOutputResult( | 28 static void ScaleCopyOutputResult( |
| 28 const GrabWindowSnapshotAsyncCallback& callback, | 29 const GrabWindowSnapshotAsyncCallback& callback, |
| 29 const gfx::Size& target_size, | 30 const gfx::Size& target_size, |
| 30 scoped_refptr<base::TaskRunner> background_task_runner, | 31 scoped_refptr<base::TaskRunner> background_task_runner, |
| 31 scoped_ptr<cc::CopyOutputResult> result); | 32 std::unique_ptr<cc::CopyOutputResult> result); |
| 32 | 33 |
| 33 static void EncodeCopyOutputResult( | 34 static void EncodeCopyOutputResult( |
| 34 const GrabWindowSnapshotAsyncPNGCallback& callback, | 35 const GrabWindowSnapshotAsyncPNGCallback& callback, |
| 35 scoped_refptr<base::TaskRunner> background_task_runner, | 36 scoped_refptr<base::TaskRunner> background_task_runner, |
| 36 scoped_ptr<cc::CopyOutputResult> result); | 37 std::unique_ptr<cc::CopyOutputResult> result); |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 DISALLOW_IMPLICIT_CONSTRUCTORS(SnapshotAsync); | 40 DISALLOW_IMPLICIT_CONSTRUCTORS(SnapshotAsync); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace ui | 43 } // namespace ui |
| 43 | 44 |
| 44 #endif // UI_SNAPSHOT_SNAPSHOT_ASYNC_H_ | 45 #endif // UI_SNAPSHOT_SNAPSHOT_ASYNC_H_ |
| OLD | NEW |