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 3// found in the LICENSE file. 4 5#include "ui/events/test/test_event_processor.h" 6 7#include "ui/events/event_target.h" 8 9namespace ui { 10namespace test { 11 12TestEventProcessor::TestEventProcessor() : num_times_processing_finished_(0) {} 13TestEventProcessor::~TestEventProcessor() {} 14 15void TestEventProcessor::SetRoot(scoped_ptr<EventTarget> root) { 16 root_ = root.Pass(); 17} 18 19void TestEventProcessor::ResetCounts() { 20 num_times_processing_finished_ = 0; 21} 22 23bool TestEventProcessor::CanDispatchToTarget(EventTarget* target) { 24 return true; 25} 26 27EventTarget* TestEventProcessor::GetRootTarget() { 28 return root_.get(); 29} 30 31EventDispatchDetails TestEventProcessor::OnEventFromSource(Event* event) { 32 return EventProcessor::OnEventFromSource(event); 33} 34 35void TestEventProcessor::OnEventProcessingFinished(Event* event) { 36 num_times_processing_finished_++; 37} 38 39} // namespace test 40} // namespace ui 41