| 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> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // 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 |
| 25 // ui::GrabWindowSnapshot callback. | 25 // ui::GrabWindowSnapshot callback. |
| 26 class SnapshotAsync { | 26 class SnapshotAsync { |
| 27 public: | 27 public: |
| 28 static void ScaleCopyOutputResult( | 28 static void ScaleCopyOutputResult( |
| 29 const GrabWindowSnapshotAsyncCallback& callback, | 29 const GrabWindowSnapshotAsyncCallback& callback, |
| 30 const gfx::Size& target_size, | 30 const gfx::Size& target_size, |
| 31 scoped_refptr<base::TaskRunner> background_task_runner, | 31 scoped_refptr<base::TaskRunner> background_task_runner, |
| 32 std::unique_ptr<cc::CopyOutputResult> result); | 32 std::unique_ptr<cc::CopyOutputResult> result); |
| 33 | 33 |
| 34 static void RunCallbackWithCopyOutputResult( | 34 static void EncodeCopyOutputResult( |
| 35 const GrabWindowSnapshotAsyncCallback& callback, | 35 const GrabWindowSnapshotAsyncPNGCallback& callback, |
| 36 scoped_refptr<base::TaskRunner> background_task_runner, |
| 36 std::unique_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 |