blob: 79928e0ac2e305772ae161b98691af58daa7a820 [file] [log] [blame]
[email protected]2e6f39e2014-05-15 19:36:361// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef UI_SNAPSHOT_SNAPSHOT_ASYNC_H_
6#define UI_SNAPSHOT_SNAPSHOT_ASYNC_H_
7
danakj25c52c32016-04-12 21:51:088#include <memory>
9
avi9c81217b2015-12-24 23:40:0510#include "base/macros.h"
[email protected]2e6f39e2014-05-15 19:36:3611#include "cc/output/copy_output_result.h"
12#include "ui/snapshot/snapshot.h"
13
14namespace base {
15class TaskRunner;
16}
17
18namespace gfx {
19class Size;
20}
21
22namespace ui {
23
24// Helper methods for async snapshots to convert a cc::CopyOutputResult into a
25// ui::GrabWindowSnapshot callback.
26class SnapshotAsync {
27 public:
28 static void ScaleCopyOutputResult(
29 const GrabWindowSnapshotAsyncCallback& callback,
30 const gfx::Size& target_size,
31 scoped_refptr<base::TaskRunner> background_task_runner,
danakj25c52c32016-04-12 21:51:0832 std::unique_ptr<cc::CopyOutputResult> result);
[email protected]2e6f39e2014-05-15 19:36:3633
eseckler7233c1a72017-01-25 15:07:5434 static void RunCallbackWithCopyOutputResult(
35 const GrabWindowSnapshotAsyncCallback& callback,
danakj25c52c32016-04-12 21:51:0836 std::unique_ptr<cc::CopyOutputResult> result);
[email protected]2e6f39e2014-05-15 19:36:3637
38 private:
39 DISALLOW_IMPLICIT_CONSTRUCTORS(SnapshotAsync);
40};
41
42} // namespace ui
43
44#endif // UI_SNAPSHOT_SNAPSHOT_ASYNC_H_