| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test_event_processor.h" | 5 #include "ui/events/test/test_event_processor.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "ui/events/event_target.h" | 9 #include "ui/events/event_target.h" |
| 8 | 10 |
| 9 namespace ui { | 11 namespace ui { |
| 10 namespace test { | 12 namespace test { |
| 11 | 13 |
| 12 TestEventProcessor::TestEventProcessor() | 14 TestEventProcessor::TestEventProcessor() |
| 13 : should_processing_occur_(true), | 15 : should_processing_occur_(true), |
| 14 num_times_processing_started_(0), | 16 num_times_processing_started_(0), |
| 15 num_times_processing_finished_(0) { | 17 num_times_processing_finished_(0) { |
| 16 } | 18 } |
| 17 | 19 |
| 18 TestEventProcessor::~TestEventProcessor() {} | 20 TestEventProcessor::~TestEventProcessor() {} |
| 19 | 21 |
| 20 void TestEventProcessor::SetRoot(scoped_ptr<EventTarget> root) { | 22 void TestEventProcessor::SetRoot(scoped_ptr<EventTarget> root) { |
| 21 root_ = root.Pass(); | 23 root_ = std::move(root); |
| 22 } | 24 } |
| 23 | 25 |
| 24 void TestEventProcessor::Reset() { | 26 void TestEventProcessor::Reset() { |
| 25 should_processing_occur_ = true; | 27 should_processing_occur_ = true; |
| 26 num_times_processing_started_ = 0; | 28 num_times_processing_started_ = 0; |
| 27 num_times_processing_finished_ = 0; | 29 num_times_processing_finished_ = 0; |
| 28 } | 30 } |
| 29 | 31 |
| 30 bool TestEventProcessor::CanDispatchToTarget(EventTarget* target) { | 32 bool TestEventProcessor::CanDispatchToTarget(EventTarget* target) { |
| 31 return true; | 33 return true; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 44 if (!should_processing_occur_) | 46 if (!should_processing_occur_) |
| 45 event->SetHandled(); | 47 event->SetHandled(); |
| 46 } | 48 } |
| 47 | 49 |
| 48 void TestEventProcessor::OnEventProcessingFinished(Event* event) { | 50 void TestEventProcessor::OnEventProcessingFinished(Event* event) { |
| 49 num_times_processing_finished_++; | 51 num_times_processing_finished_++; |
| 50 } | 52 } |
| 51 | 53 |
| 52 } // namespace test | 54 } // namespace test |
| 53 } // namespace ui | 55 } // namespace ui |
| OLD | NEW |