| 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 "ui/events/test/event_generator.h" | 5 #include "ui/events/test/event_generator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 } // namespace | 88 } // namespace |
| 89 | 89 |
| 90 EventGeneratorDelegate* EventGenerator::default_delegate = NULL; | 90 EventGeneratorDelegate* EventGenerator::default_delegate = NULL; |
| 91 | 91 |
| 92 EventGenerator::EventGenerator(gfx::NativeWindow root_window) | 92 EventGenerator::EventGenerator(gfx::NativeWindow root_window) |
| 93 : current_target_(NULL), | 93 : current_target_(NULL), |
| 94 flags_(0), | 94 flags_(0), |
| 95 grab_(false), | 95 grab_(false), |
| 96 async_(false), | 96 async_(false), |
| 97 targeting_application_(false) { | 97 target_(Target::WIDGET) { |
| 98 Init(root_window, NULL); | 98 Init(root_window, NULL); |
| 99 } | 99 } |
| 100 | 100 |
| 101 EventGenerator::EventGenerator(gfx::NativeWindow root_window, | 101 EventGenerator::EventGenerator(gfx::NativeWindow root_window, |
| 102 const gfx::Point& point) | 102 const gfx::Point& point) |
| 103 : current_location_(point), | 103 : current_location_(point), |
| 104 current_target_(NULL), | 104 current_target_(NULL), |
| 105 flags_(0), | 105 flags_(0), |
| 106 grab_(false), | 106 grab_(false), |
| 107 async_(false), | 107 async_(false), |
| 108 targeting_application_(false) { | 108 target_(Target::WIDGET) { |
| 109 Init(root_window, NULL); | 109 Init(root_window, NULL); |
| 110 } | 110 } |
| 111 | 111 |
| 112 EventGenerator::EventGenerator(gfx::NativeWindow root_window, | 112 EventGenerator::EventGenerator(gfx::NativeWindow root_window, |
| 113 gfx::NativeWindow window) | 113 gfx::NativeWindow window) |
| 114 : current_target_(NULL), | 114 : current_target_(NULL), |
| 115 flags_(0), | 115 flags_(0), |
| 116 grab_(false), | 116 grab_(false), |
| 117 async_(false), | 117 async_(false), |
| 118 targeting_application_(false) { | 118 target_(Target::WIDGET) { |
| 119 Init(root_window, window); | 119 Init(root_window, window); |
| 120 } | 120 } |
| 121 | 121 |
| 122 EventGenerator::EventGenerator(EventGeneratorDelegate* delegate) | 122 EventGenerator::EventGenerator(EventGeneratorDelegate* delegate) |
| 123 : delegate_(delegate), | 123 : delegate_(delegate), |
| 124 current_target_(NULL), | 124 current_target_(NULL), |
| 125 flags_(0), | 125 flags_(0), |
| 126 grab_(false), | 126 grab_(false), |
| 127 async_(false), | 127 async_(false), |
| 128 targeting_application_(false) { | 128 target_(Target::WIDGET) { |
| 129 Init(NULL, NULL); | 129 Init(NULL, NULL); |
| 130 } | 130 } |
| 131 | 131 |
| 132 EventGenerator::~EventGenerator() { | 132 EventGenerator::~EventGenerator() { |
| 133 pending_events_.clear(); | 133 pending_events_.clear(); |
| 134 delegate()->SetContext(NULL, NULL, NULL); | 134 delegate()->SetContext(NULL, NULL, NULL); |
| 135 ui::SetEventTickClockForTesting(nullptr); | 135 ui::SetEventTickClockForTesting(nullptr); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void EventGenerator::PressLeftButton() { | 138 void EventGenerator::PressLeftButton() { |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 return default_delegate; | 707 return default_delegate; |
| 708 } | 708 } |
| 709 | 709 |
| 710 EventGeneratorDelegate* EventGenerator::delegate() { | 710 EventGeneratorDelegate* EventGenerator::delegate() { |
| 711 return const_cast<EventGeneratorDelegate*>( | 711 return const_cast<EventGeneratorDelegate*>( |
| 712 const_cast<const EventGenerator*>(this)->delegate()); | 712 const_cast<const EventGenerator*>(this)->delegate()); |
| 713 } | 713 } |
| 714 | 714 |
| 715 } // namespace test | 715 } // namespace test |
| 716 } // namespace ui | 716 } // namespace ui |
| OLD | NEW |