| Index: ui/aura/test/test_event_filter.cc
|
| diff --git a/ui/aura/test/test_event_filter.cc b/ui/aura/test/test_event_filter.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..de9968919d79cf5fbb4261f52e2bdebe69b4b1e7
|
| --- /dev/null
|
| +++ b/ui/aura/test/test_event_filter.cc
|
| @@ -0,0 +1,47 @@
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ui/aura/test/test_event_filter.h"
|
| +
|
| +namespace aura {
|
| +namespace test {
|
| +
|
| +TestEventFilter::TestEventFilter(Window* owner)
|
| + : EventFilter(owner),
|
| + key_event_count_(0),
|
| + mouse_event_count_(0),
|
| + touch_event_count_(0),
|
| + consumes_key_events_(false),
|
| + consumes_mouse_events_(false),
|
| + consumes_touch_events_(false) {
|
| +}
|
| +
|
| +TestEventFilter::~TestEventFilter() {
|
| +}
|
| +
|
| +void TestEventFilter::ResetCounts() {
|
| + key_event_count_ = 0;
|
| + mouse_event_count_ = 0;
|
| + touch_event_count_ = 0;
|
| +}
|
| +
|
| +bool TestEventFilter::PreHandleKeyEvent(Window* target, KeyEvent* event) {
|
| + ++key_event_count_;
|
| + return consumes_key_events_;
|
| +}
|
| +
|
| +bool TestEventFilter::PreHandleMouseEvent(Window* target, MouseEvent* event) {
|
| + ++mouse_event_count_;
|
| + return consumes_mouse_events_;
|
| +}
|
| +
|
| +ui::TouchStatus TestEventFilter::PreHandleTouchEvent(Window* target,
|
| + TouchEvent* event) {
|
| + ++touch_event_count_;
|
| + // TODO(sadrul): !
|
| + return ui::TOUCH_STATUS_UNKNOWN;
|
| +}
|
| +
|
| +} // namespace test
|
| +} // namespace aura
|
|
|