Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: services/ui/ws/test_change_tracker.cc

Issue 2511883006: Mojo C++ bindings: switch services/ui/public/interfaces mojom target to use STL types. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/test_change_tracker.h ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "services/ui/ws/test_change_tracker.h" 5 #include "services/ui/ws/test_change_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 for (size_t i = 0; i < changes[0].windows.size(); ++i) 195 for (size_t i = 0; i < changes[0].windows.size(); ++i)
196 window_strings[i] = "[" + changes[0].windows[i].ToString() + "]"; 196 window_strings[i] = "[" + changes[0].windows[i].ToString() + "]";
197 return base::JoinString(window_strings, ","); 197 return base::JoinString(window_strings, ",");
198 } 198 }
199 199
200 TestWindow WindowDataToTestWindow(const mojom::WindowDataPtr& data) { 200 TestWindow WindowDataToTestWindow(const mojom::WindowDataPtr& data) {
201 TestWindow window; 201 TestWindow window;
202 window.parent_id = data->parent_id; 202 window.parent_id = data->parent_id;
203 window.window_id = data->window_id; 203 window.window_id = data->window_id;
204 window.visible = data->visible; 204 window.visible = data->visible;
205 window.properties = 205 window.properties = mojo::UnorderedMapToMap(data->properties);
206 data->properties.To<std::map<std::string, std::vector<uint8_t>>>();
207 return window; 206 return window;
208 } 207 }
209 208
210 void WindowDatasToTestWindows(const Array<mojom::WindowDataPtr>& data, 209 void WindowDatasToTestWindows(const std::vector<mojom::WindowDataPtr>& data,
211 std::vector<TestWindow>* test_windows) { 210 std::vector<TestWindow>* test_windows) {
212 for (size_t i = 0; i < data.size(); ++i) 211 for (size_t i = 0; i < data.size(); ++i)
213 test_windows->push_back(WindowDataToTestWindow(data[i])); 212 test_windows->push_back(WindowDataToTestWindow(data[i]));
214 } 213 }
215 214
216 Change::Change() 215 Change::Change()
217 : type(CHANGE_TYPE_EMBED), 216 : type(CHANGE_TYPE_EMBED),
218 client_id(0), 217 client_id(0),
219 window_id(0), 218 window_id(0),
220 window_id2(0), 219 window_id2(0),
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 458
460 std::string TestWindow::ToString2() const { 459 std::string TestWindow::ToString2() const {
461 return base::StringPrintf( 460 return base::StringPrintf(
462 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(), 461 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(),
463 WindowIdToString(parent_id).c_str(), visible ? "true" : "false"); 462 WindowIdToString(parent_id).c_str(), visible ? "true" : "false");
464 } 463 }
465 464
466 } // namespace ws 465 } // namespace ws
467 466
468 } // namespace ui 467 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/test_change_tracker.h ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698