OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "mojo/services/clipboard/clipboard_standalone_impl.h" | 5 #include "mojo/services/clipboard/clipboard_standalone_impl.h" |
6 | 6 |
7 namespace mojo { | 7 namespace mojo { |
8 | 8 |
9 typedef std::vector<uint8_t> ByteVector; | 9 typedef std::vector<uint8_t> ByteVector; |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Clipboard::Type clipboard_type, | 90 Clipboard::Type clipboard_type, |
91 mojo::Array<MimeTypePairPtr> data) { | 91 mojo::Array<MimeTypePairPtr> data) { |
92 std::map<std::string, ByteVector> mime_data; | 92 std::map<std::string, ByteVector> mime_data; |
93 for (size_t i = 0; i < data.size(); ++i) | 93 for (size_t i = 0; i < data.size(); ++i) |
94 mime_data[data[i]->mime_type] = data[i]->data; | 94 mime_data[data[i]->mime_type] = data[i]->data; |
95 | 95 |
96 sequence_number_[clipboard_type]++; | 96 sequence_number_[clipboard_type]++; |
97 clipboard_state_[clipboard_type]->SetData(&mime_data); | 97 clipboard_state_[clipboard_type]->SetData(&mime_data); |
98 } | 98 } |
99 | 99 |
| 100 void ClipboardStandaloneImpl::FakeTestMethod( |
| 101 const mojo::Callback<void(mojo::Map<mojo::String, |
| 102 mojo::String>)>& callback) { |
| 103 std::map<std::string, std::string> blah; |
| 104 blah["one"] = "more"; |
| 105 blah["two"] = "less"; |
| 106 callback.Run(Map<String, String>::From(blah)); |
| 107 } |
| 108 |
100 } // namespace mojo | 109 } // namespace mojo |
OLD | NEW |