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 "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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 358 } |
359 | 359 |
360 void TestChangeTracker::OnWindowInputEvent(Id window_id, | 360 void TestChangeTracker::OnWindowInputEvent(Id window_id, |
361 const ui::Event& event, | 361 const ui::Event& event, |
362 bool matches_pointer_watcher) { | 362 bool matches_pointer_watcher) { |
363 Change change; | 363 Change change; |
364 change.type = CHANGE_TYPE_INPUT_EVENT; | 364 change.type = CHANGE_TYPE_INPUT_EVENT; |
365 change.window_id = window_id; | 365 change.window_id = window_id; |
366 change.event_action = static_cast<int32_t>(event.type()); | 366 change.event_action = static_cast<int32_t>(event.type()); |
367 change.matches_pointer_watcher = matches_pointer_watcher; | 367 change.matches_pointer_watcher = matches_pointer_watcher; |
| 368 if (event.IsKeyEvent() && event.AsKeyEvent()->properties()) |
| 369 change.key_event_properties = *event.AsKeyEvent()->properties(); |
368 AddChange(change); | 370 AddChange(change); |
369 } | 371 } |
370 | 372 |
371 void TestChangeTracker::OnPointerEventObserved(const ui::Event& event, | 373 void TestChangeTracker::OnPointerEventObserved(const ui::Event& event, |
372 uint32_t window_id) { | 374 uint32_t window_id) { |
373 Change change; | 375 Change change; |
374 change.type = CHANGE_TYPE_POINTER_WATCHER_EVENT; | 376 change.type = CHANGE_TYPE_POINTER_WATCHER_EVENT; |
375 change.event_action = static_cast<int32_t>(event.type()); | 377 change.event_action = static_cast<int32_t>(event.type()); |
376 change.window_id = window_id; | 378 change.window_id = window_id; |
377 AddChange(change); | 379 AddChange(change); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 | 462 |
461 std::string TestWindow::ToString2() const { | 463 std::string TestWindow::ToString2() const { |
462 return base::StringPrintf( | 464 return base::StringPrintf( |
463 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(), | 465 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(), |
464 WindowIdToString(parent_id).c_str(), visible ? "true" : "false"); | 466 WindowIdToString(parent_id).c_str(), visible ? "true" : "false"); |
465 } | 467 } |
466 | 468 |
467 } // namespace ws | 469 } // namespace ws |
468 | 470 |
469 } // namespace ui | 471 } // namespace ui |
OLD | NEW |