Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: ui/aura/test/test_event_filter.cc

Issue 8565018: [Aura] Support additonal event filters in DesktopEventFilter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo and remove no-longer-needed algorithm header Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/test/test_event_filter.h ('k') | ui/aura_shell/desktop_event_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/aura/test/test_event_filter.h ('k') | ui/aura_shell/desktop_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698