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

Side by Side Diff: services/ui/ws/test_utils.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_utils.h ('k') | services/ui/ws/window_tree.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 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 "services/ui/ws/test_utils.h" 5 #include "services/ui/ws/test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // TestWindowManager ---------------------------------------------------------- 171 // TestWindowManager ----------------------------------------------------------
172 172
173 void TestWindowManager::WmDisplayRemoved(int64_t display_id) { 173 void TestWindowManager::WmDisplayRemoved(int64_t display_id) {
174 got_display_removed_ = true; 174 got_display_removed_ = true;
175 display_removed_id_ = display_id; 175 display_removed_id_ = display_id;
176 } 176 }
177 177
178 void TestWindowManager::WmCreateTopLevelWindow( 178 void TestWindowManager::WmCreateTopLevelWindow(
179 uint32_t change_id, 179 uint32_t change_id,
180 ClientSpecificId requesting_client_id, 180 ClientSpecificId requesting_client_id,
181 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) { 181 const std::unordered_map<std::string, std::vector<uint8_t>>& properties) {
182 got_create_top_level_window_ = true; 182 got_create_top_level_window_ = true;
183 change_id_ = change_id; 183 change_id_ = change_id;
184 } 184 }
185 185
186 void TestWindowManager::WmClientJankinessChanged(ClientSpecificId client_id, 186 void TestWindowManager::WmClientJankinessChanged(ClientSpecificId client_id,
187 bool janky) {} 187 bool janky) {}
188 188
189 void TestWindowManager::WmPerformMoveLoop(uint32_t change_id, 189 void TestWindowManager::WmPerformMoveLoop(uint32_t change_id,
190 uint32_t window_id, 190 uint32_t window_id,
191 mojom::MoveLoopSource source, 191 mojom::MoveLoopSource source,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window, 246 void TestWindowTreeClient::OnWindowBoundsChanged(uint32_t window,
247 const gfx::Rect& old_bounds, 247 const gfx::Rect& old_bounds,
248 const gfx::Rect& new_bounds) { 248 const gfx::Rect& new_bounds) {
249 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), 249 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds),
250 std::move(new_bounds)); 250 std::move(new_bounds));
251 } 251 }
252 252
253 void TestWindowTreeClient::OnClientAreaChanged( 253 void TestWindowTreeClient::OnClientAreaChanged(
254 uint32_t window_id, 254 uint32_t window_id,
255 const gfx::Insets& new_client_area, 255 const gfx::Insets& new_client_area,
256 mojo::Array<gfx::Rect> new_additional_client_areas) {} 256 const std::vector<gfx::Rect>& new_additional_client_areas) {}
257 257
258 void TestWindowTreeClient::OnTransientWindowAdded( 258 void TestWindowTreeClient::OnTransientWindowAdded(
259 uint32_t window_id, 259 uint32_t window_id,
260 uint32_t transient_window_id) {} 260 uint32_t transient_window_id) {}
261 261
262 void TestWindowTreeClient::OnTransientWindowRemoved( 262 void TestWindowTreeClient::OnTransientWindowRemoved(
263 uint32_t window_id, 263 uint32_t window_id,
264 uint32_t transient_window_id) {} 264 uint32_t transient_window_id) {}
265 265
266 void TestWindowTreeClient::OnWindowHierarchyChanged( 266 void TestWindowTreeClient::OnWindowHierarchyChanged(
267 uint32_t window, 267 uint32_t window,
268 uint32_t old_parent, 268 uint32_t old_parent,
269 uint32_t new_parent, 269 uint32_t new_parent,
270 mojo::Array<mojom::WindowDataPtr> windows) { 270 std::vector<mojom::WindowDataPtr> windows) {
271 tracker_.OnWindowHierarchyChanged(window, old_parent, new_parent, 271 tracker_.OnWindowHierarchyChanged(window, old_parent, new_parent,
272 std::move(windows)); 272 std::move(windows));
273 } 273 }
274 274
275 void TestWindowTreeClient::OnWindowReordered(uint32_t window_id, 275 void TestWindowTreeClient::OnWindowReordered(uint32_t window_id,
276 uint32_t relative_window_id, 276 uint32_t relative_window_id,
277 mojom::OrderDirection direction) { 277 mojom::OrderDirection direction) {
278 tracker_.OnWindowReordered(window_id, relative_window_id, direction); 278 tracker_.OnWindowReordered(window_id, relative_window_id, direction);
279 } 279 }
280 280
(...skipping 12 matching lines...) Expand all
293 tracker_.OnWindowOpacityChanged(window, new_opacity); 293 tracker_.OnWindowOpacityChanged(window, new_opacity);
294 } 294 }
295 295
296 void TestWindowTreeClient::OnWindowParentDrawnStateChanged(uint32_t window, 296 void TestWindowTreeClient::OnWindowParentDrawnStateChanged(uint32_t window,
297 bool drawn) { 297 bool drawn) {
298 tracker_.OnWindowParentDrawnStateChanged(window, drawn); 298 tracker_.OnWindowParentDrawnStateChanged(window, drawn);
299 } 299 }
300 300
301 void TestWindowTreeClient::OnWindowSharedPropertyChanged( 301 void TestWindowTreeClient::OnWindowSharedPropertyChanged(
302 uint32_t window, 302 uint32_t window,
303 const mojo::String& name, 303 const std::string& name,
304 mojo::Array<uint8_t> new_data) { 304 const base::Optional<std::vector<uint8_t>>& new_data) {
305 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); 305 tracker_.OnWindowSharedPropertyChanged(window, name, new_data);
306 } 306 }
307 307
308 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, 308 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id,
309 uint32_t window, 309 uint32_t window,
310 std::unique_ptr<ui::Event> event, 310 std::unique_ptr<ui::Event> event,
311 bool matches_pointer_watcher) { 311 bool matches_pointer_watcher) {
312 tracker_.OnWindowInputEvent(window, *event.get(), matches_pointer_watcher); 312 tracker_.OnWindowInputEvent(window, *event.get(), matches_pointer_watcher);
313 } 313 }
314 314
315 void TestWindowTreeClient::OnPointerEventObserved( 315 void TestWindowTreeClient::OnPointerEventObserved(
(...skipping 12 matching lines...) Expand all
328 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id); 328 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id);
329 } 329 }
330 330
331 void TestWindowTreeClient::OnWindowSurfaceChanged( 331 void TestWindowTreeClient::OnWindowSurfaceChanged(
332 Id window_id, 332 Id window_id,
333 const cc::SurfaceId& surface_id, 333 const cc::SurfaceId& surface_id,
334 const gfx::Size& frame_size, 334 const gfx::Size& frame_size,
335 float device_scale_factor) {} 335 float device_scale_factor) {}
336 336
337 void TestWindowTreeClient::OnDragDropStart( 337 void TestWindowTreeClient::OnDragDropStart(
338 mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data) {} 338 const std::unordered_map<std::string, std::vector<uint8_t>>& mime_data) {}
339 339
340 void TestWindowTreeClient::OnDragEnter(uint32_t window, 340 void TestWindowTreeClient::OnDragEnter(uint32_t window,
341 uint32_t key_state, 341 uint32_t key_state,
342 const gfx::Point& position, 342 const gfx::Point& position,
343 uint32_t effect_bitmask, 343 uint32_t effect_bitmask,
344 const OnDragEnterCallback& callback) {} 344 const OnDragEnterCallback& callback) {}
345 345
346 void TestWindowTreeClient::OnDragOver(uint32_t window, 346 void TestWindowTreeClient::OnDragOver(uint32_t window,
347 uint32_t key_state, 347 uint32_t key_state,
348 const gfx::Point& position, 348 const gfx::Point& position,
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 return nullptr; 580 return nullptr;
581 if (!tree->AddWindow(parent_client_id, client_window_id)) 581 if (!tree->AddWindow(parent_client_id, client_window_id))
582 return nullptr; 582 return nullptr;
583 *client_id = client_window_id; 583 *client_id = client_window_id;
584 return tree->GetWindowByClientId(client_window_id); 584 return tree->GetWindowByClientId(client_window_id);
585 } 585 }
586 586
587 } // namespace test 587 } // namespace test
588 } // namespace ws 588 } // namespace ws
589 } // namespace ui 589 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698