OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/mus/clipboard/clipboard_impl.h" | 5 #include "components/mus/clipboard/clipboard_impl.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "mojo/common/common_type_converters.h" | 11 #include "mojo/common/common_type_converters.h" |
12 #include "mojo/public/cpp/bindings/array.h" | 12 #include "mojo/public/cpp/bindings/array.h" |
| 13 #include "mojo/public/cpp/bindings/callback.h" |
13 #include "mojo/public/cpp/bindings/string.h" | 14 #include "mojo/public/cpp/bindings/string.h" |
14 | 15 |
15 using mojo::Array; | 16 using mojo::Array; |
16 using mojo::Map; | 17 using mojo::Map; |
17 using mojo::String; | 18 using mojo::String; |
18 | 19 |
19 namespace mus { | 20 namespace mus { |
20 namespace clipboard { | 21 namespace clipboard { |
21 | 22 |
22 // ClipboardData contains data copied to the Clipboard for a variety of formats. | 23 // ClipboardData contains data copied to the Clipboard for a variety of formats. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 Clipboard::Type clipboard_type, | 100 Clipboard::Type clipboard_type, |
100 Map<String, Array<uint8_t>> data, | 101 Map<String, Array<uint8_t>> data, |
101 const WriteClipboardDataCallback& callback) { | 102 const WriteClipboardDataCallback& callback) { |
102 int clipboard_num = static_cast<int>(clipboard_type); | 103 int clipboard_num = static_cast<int>(clipboard_type); |
103 clipboard_state_[clipboard_num]->SetData(std::move(data)); | 104 clipboard_state_[clipboard_num]->SetData(std::move(data)); |
104 callback.Run(clipboard_state_[clipboard_num]->sequence_number()); | 105 callback.Run(clipboard_state_[clipboard_num]->sequence_number()); |
105 } | 106 } |
106 | 107 |
107 } // namespace clipboard | 108 } // namespace clipboard |
108 } // namespace mus | 109 } // namespace mus |
OLD | NEW |