| 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 "components/mus/ws/test_change_tracker.h" | 5 #include "components/mus/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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 for (size_t i = 0; i < data.size(); ++i) | 208 for (size_t i = 0; i < data.size(); ++i) |
| 209 test_windows->push_back(WindowDataToTestWindow(data[i])); | 209 test_windows->push_back(WindowDataToTestWindow(data[i])); |
| 210 } | 210 } |
| 211 | 211 |
| 212 Change::Change() | 212 Change::Change() |
| 213 : type(CHANGE_TYPE_EMBED), | 213 : type(CHANGE_TYPE_EMBED), |
| 214 connection_id(0), | 214 connection_id(0), |
| 215 window_id(0), | 215 window_id(0), |
| 216 window_id2(0), | 216 window_id2(0), |
| 217 window_id3(0), | 217 window_id3(0), |
| 218 event_id(0u), |
| 218 event_action(0), | 219 event_action(0), |
| 219 direction(mojom::OrderDirection::ABOVE), | 220 direction(mojom::OrderDirection::ABOVE), |
| 220 bool_value(false), | 221 bool_value(false), |
| 222 float_value(0.f), |
| 223 cursor_id(0), |
| 221 change_id(0u) {} | 224 change_id(0u) {} |
| 222 | 225 |
| 223 Change::Change(const Change& other) = default; | 226 Change::Change(const Change& other) = default; |
| 224 | 227 |
| 225 Change::~Change() {} | 228 Change::~Change() {} |
| 226 | 229 |
| 227 TestChangeTracker::TestChangeTracker() : delegate_(NULL) {} | 230 TestChangeTracker::TestChangeTracker() : delegate_(NULL) {} |
| 228 | 231 |
| 229 TestChangeTracker::~TestChangeTracker() {} | 232 TestChangeTracker::~TestChangeTracker() {} |
| 230 | 233 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 357 |
| 355 void TestChangeTracker::OnWindowParentDrawnStateChanged(Id window_id, | 358 void TestChangeTracker::OnWindowParentDrawnStateChanged(Id window_id, |
| 356 bool drawn) { | 359 bool drawn) { |
| 357 Change change; | 360 Change change; |
| 358 change.type = CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED; | 361 change.type = CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED; |
| 359 change.window_id = window_id; | 362 change.window_id = window_id; |
| 360 change.bool_value = drawn; | 363 change.bool_value = drawn; |
| 361 AddChange(change); | 364 AddChange(change); |
| 362 } | 365 } |
| 363 | 366 |
| 364 void TestChangeTracker::OnWindowInputEvent(Id window_id, | 367 void TestChangeTracker::OnWindowInputEvent(uint32_t event_id, |
| 368 Id window_id, |
| 365 mojom::EventPtr event) { | 369 mojom::EventPtr event) { |
| 366 Change change; | 370 Change change; |
| 367 change.type = CHANGE_TYPE_INPUT_EVENT; | 371 change.type = CHANGE_TYPE_INPUT_EVENT; |
| 368 change.window_id = window_id; | 372 change.window_id = window_id; |
| 373 change.event_id = event_id; |
| 369 change.event_action = static_cast<int32_t>(event->action); | 374 change.event_action = static_cast<int32_t>(event->action); |
| 375 if (!event->pointer_data.is_null()) { |
| 376 change.event_location.set_x(event->pointer_data->location->x); |
| 377 change.event_location.set_y(event->pointer_data->location->y); |
| 378 } |
| 370 AddChange(change); | 379 AddChange(change); |
| 371 } | 380 } |
| 372 | 381 |
| 373 void TestChangeTracker::OnWindowSharedPropertyChanged(Id window_id, | 382 void TestChangeTracker::OnWindowSharedPropertyChanged(Id window_id, |
| 374 String name, | 383 String name, |
| 375 Array<uint8_t> data) { | 384 Array<uint8_t> data) { |
| 376 Change change; | 385 Change change; |
| 377 change.type = CHANGE_TYPE_PROPERTY_CHANGED; | 386 change.type = CHANGE_TYPE_PROPERTY_CHANGED; |
| 378 change.window_id = window_id; | 387 change.window_id = window_id; |
| 379 change.property_key = name; | 388 change.property_key = name; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 449 |
| 441 std::string TestWindow::ToString2() const { | 450 std::string TestWindow::ToString2() const { |
| 442 return base::StringPrintf( | 451 return base::StringPrintf( |
| 443 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(), | 452 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(), |
| 444 WindowIdToString(parent_id).c_str(), visible ? "true" : "false"); | 453 WindowIdToString(parent_id).c_str(), visible ? "true" : "false"); |
| 445 } | 454 } |
| 446 | 455 |
| 447 } // namespace ws | 456 } // namespace ws |
| 448 | 457 |
| 449 } // namespace mus | 458 } // namespace mus |
| OLD | NEW |