summaryrefslogtreecommitdiffstats
path: root/ash/event_rewriter_delegate.h
diff options
context:
space:
mode:
authoryusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 01:09:03 +0000
committeryusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 01:09:03 +0000
commitb9d224c8ffd5f16b3c5219547d841d63b6cf4354 (patch)
tree790474c98218c8e8509f23744d3eb238281b010a /ash/event_rewriter_delegate.h
parent3ba3c71164c6e5379c8090d0477bcfa36fbbb6c4 (diff)
downloadchromium_src-b9d224c8ffd5f16b3c5219547d841d63b6cf4354.zip
chromium_src-b9d224c8ffd5f16b3c5219547d841d63b6cf4354.tar.gz
chromium_src-b9d224c8ffd5f16b3c5219547d841d63b6cf4354.tar.bz2
Rename KeyRewriter to EventRewriter since it now rewrites aura::LocationEvent in addition to aura::KeyEvent.
BUG=133510 TEST=unit_tests and aura_shell_unittests passed Review URL: https://chromiumcodereview.appspot.com/10753008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/event_rewriter_delegate.h')
-rw-r--r--ash/event_rewriter_delegate.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/ash/event_rewriter_delegate.h b/ash/event_rewriter_delegate.h
new file mode 100644
index 0000000..340f283
--- /dev/null
+++ b/ash/event_rewriter_delegate.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 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.
+
+#ifndef ASH_EVENT_REWRITER_DELEGATE_H_
+#define ASH_EVENT_REWRITER_DELEGATE_H_
+
+namespace aura {
+class KeyEvent;
+class LocatedEvent;
+} // namespace aura
+
+namespace ash {
+
+// Delegate for rewriting or filtering an event.
+class EventRewriterDelegate {
+ public:
+ enum Action {
+ ACTION_REWRITE_EVENT,
+ ACTION_DROP_EVENT,
+ };
+
+ virtual ~EventRewriterDelegate() {}
+
+ // A derived class can do either of the following:
+ // 1) Just return ACTION_DROP_EVENT to drop the |event|.
+ // 2) Rewrite the |event| and return ACTION_REWRITE_EVENT.
+ virtual Action RewriteOrFilterKeyEvent(aura::KeyEvent* event) = 0;
+ virtual Action RewriteOrFilterLocatedEvent(aura::LocatedEvent* event) = 0;
+};
+
+} // namespace ash
+
+#endif // ASH_EVENT_REWRITER_DELEGATE_H_