| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 private: | 77 private: |
| 78 DISALLOW_COPY_AND_ASSIGN(TestTouchEvent); | 78 DISALLOW_COPY_AND_ASSIGN(TestTouchEvent); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 const int kAllButtonMask = ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON; | 81 const int kAllButtonMask = ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON; |
| 82 | 82 |
| 83 } // namespace | 83 } // namespace |
| 84 | 84 |
| 85 EventGeneratorDelegate* EventGenerator::default_delegate = NULL; | 85 EventGeneratorDelegate* EventGenerator::default_delegate = NULL; |
| 86 | 86 |
| 87 EventGenerator::EventGenerator(gfx::NativeWindow root_window) | 87 EventGenerator::EventGenerator(gfx::NativeWindow root_window) { |
| 88 : current_target_(NULL), | |
| 89 flags_(0), | |
| 90 grab_(false), | |
| 91 async_(false), | |
| 92 target_(Target::WIDGET) { | |
| 93 Init(root_window, NULL); | 88 Init(root_window, NULL); |
| 94 } | 89 } |
| 95 | 90 |
| 96 EventGenerator::EventGenerator(gfx::NativeWindow root_window, | 91 EventGenerator::EventGenerator(gfx::NativeWindow root_window, |
| 97 const gfx::Point& point) | 92 const gfx::Point& point) |
| 98 : current_location_(point), | 93 : current_location_(point) { |
| 99 current_target_(NULL), | |
| 100 flags_(0), | |
| 101 grab_(false), | |
| 102 async_(false), | |
| 103 target_(Target::WIDGET) { | |
| 104 Init(root_window, NULL); | 94 Init(root_window, NULL); |
| 105 } | 95 } |
| 106 | 96 |
| 107 EventGenerator::EventGenerator(gfx::NativeWindow root_window, | 97 EventGenerator::EventGenerator(gfx::NativeWindow root_window, |
| 108 gfx::NativeWindow window) | 98 gfx::NativeWindow window) { |
| 109 : current_target_(NULL), | |
| 110 flags_(0), | |
| 111 grab_(false), | |
| 112 async_(false), | |
| 113 target_(Target::WIDGET) { | |
| 114 Init(root_window, window); | 99 Init(root_window, window); |
| 115 } | 100 } |
| 116 | 101 |
| 117 EventGenerator::EventGenerator(EventGeneratorDelegate* delegate) | 102 EventGenerator::EventGenerator(EventGeneratorDelegate* delegate) |
| 118 : delegate_(delegate), | 103 : delegate_(delegate) { |
| 119 current_target_(NULL), | |
| 120 flags_(0), | |
| 121 grab_(false), | |
| 122 async_(false), | |
| 123 target_(Target::WIDGET) { | |
| 124 Init(NULL, NULL); | 104 Init(NULL, NULL); |
| 125 } | 105 } |
| 126 | 106 |
| 127 EventGenerator::~EventGenerator() { | 107 EventGenerator::~EventGenerator() { |
| 128 pending_events_.clear(); | 108 pending_events_.clear(); |
| 129 delegate()->SetContext(NULL, NULL, NULL); | 109 delegate()->SetContext(NULL, NULL, NULL); |
| 130 ui::SetEventTickClockForTesting(nullptr); | 110 ui::SetEventTickClockForTesting(nullptr); |
| 131 } | 111 } |
| 132 | 112 |
| 133 void EventGenerator::PressLeftButton() { | 113 void EventGenerator::PressLeftButton() { |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 return default_delegate; | 744 return default_delegate; |
| 765 } | 745 } |
| 766 | 746 |
| 767 EventGeneratorDelegate* EventGenerator::delegate() { | 747 EventGeneratorDelegate* EventGenerator::delegate() { |
| 768 return const_cast<EventGeneratorDelegate*>( | 748 return const_cast<EventGeneratorDelegate*>( |
| 769 const_cast<const EventGenerator*>(this)->delegate()); | 749 const_cast<const EventGenerator*>(this)->delegate()); |
| 770 } | 750 } |
| 771 | 751 |
| 772 } // namespace test | 752 } // namespace test |
| 773 } // namespace ui | 753 } // namespace ui |
| OLD | NEW |