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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "components/mus/public/interfaces/window_tree.mojom.h" | 9 #include "components/mus/public/interfaces/window_tree.mojom.h" |
10 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 10 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 0; | 234 0; |
235 } | 235 } |
236 | 236 |
237 Id NewWindow(ConnectionSpecificId window_id) { | 237 Id NewWindow(ConnectionSpecificId window_id) { |
238 return NewWindowWithCompleteId(BuildWindowId(connection_id_, window_id)); | 238 return NewWindowWithCompleteId(BuildWindowId(connection_id_, window_id)); |
239 } | 239 } |
240 | 240 |
241 // Generally you want NewWindow(), but use this if you need to test given | 241 // Generally you want NewWindow(), but use this if you need to test given |
242 // a complete window id (NewWindow() ors with the connection id). | 242 // a complete window id (NewWindow() ors with the connection id). |
243 Id NewWindowWithCompleteId(Id id) { | 243 Id NewWindowWithCompleteId(Id id) { |
| 244 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties; |
244 const uint32_t change_id = GetAndAdvanceChangeId(); | 245 const uint32_t change_id = GetAndAdvanceChangeId(); |
245 tree()->NewWindow(change_id, id); | 246 tree()->NewWindow(change_id, id, properties.Pass()); |
246 return WaitForChangeCompleted(change_id) ? id : 0; | 247 return WaitForChangeCompleted(change_id) ? id : 0; |
247 } | 248 } |
248 | 249 |
249 void set_root_window(Id root_window_id) { root_window_id_ = root_window_id; } | 250 void set_root_window(Id root_window_id) { root_window_id_ = root_window_id; } |
250 | 251 |
251 bool SetWindowProperty(Id window_id, | 252 bool SetWindowProperty(Id window_id, |
252 const std::string& name, | 253 const std::string& name, |
253 const std::vector<uint8_t>* data) { | 254 const std::vector<uint8_t>* data) { |
254 Array<uint8_t> mojo_data; | 255 Array<uint8_t> mojo_data; |
255 if (data) | 256 if (data) |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 // originating connection. | 1763 // originating connection. |
1763 | 1764 |
1764 // TODO(sky): make sure coverage of what was | 1765 // TODO(sky): make sure coverage of what was |
1765 // WindowManagerTest.SecondEmbedRoot_InitService and | 1766 // WindowManagerTest.SecondEmbedRoot_InitService and |
1766 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window | 1767 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window |
1767 // manager | 1768 // manager |
1768 // tests. | 1769 // tests. |
1769 | 1770 |
1770 } // namespace ws | 1771 } // namespace ws |
1771 } // namespace mus | 1772 } // namespace mus |
OLD | NEW |