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

Unified Diff: ash/wm/key_rewriter_event_filter.h

Issue 9838010: Automatically remap Command key on an Apple keyboard to Control [part 1 of 2 - Ash part] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 8 years, 9 months 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 | « ash/shell.cc ('k') | ash/wm/key_rewriter_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/key_rewriter_event_filter.h
diff --git a/ash/wm/key_rewriter_event_filter.h b/ash/wm/key_rewriter_event_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..55aeeb35b708d8ba105240c36981e970047772f4
--- /dev/null
+++ b/ash/wm/key_rewriter_event_filter.h
@@ -0,0 +1,50 @@
+// 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_WM_KEY_REWRITER_EVENT_FILTER_
+#define ASH_WM_KEY_REWRITER_EVENT_FILTER_
+#pragma once
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/aura/event_filter.h"
+
+namespace ash {
+
+class KeyRewriterDelegate;
+
+namespace internal {
+
+// An event filter that rewrites or drops a key event.
+class ASH_EXPORT KeyRewriterEventFilter : public aura::EventFilter {
+ public:
+ KeyRewriterEventFilter();
+ virtual ~KeyRewriterEventFilter();
+
+ void SetKeyRewriterDelegate(scoped_ptr<KeyRewriterDelegate> delegate);
+
+ private:
+ // Overridden from aura::EventFilter:
+ virtual bool PreHandleKeyEvent(aura::Window* target,
+ aura::KeyEvent* event) OVERRIDE;
+ virtual bool PreHandleMouseEvent(aura::Window* target,
+ aura::MouseEvent* event) OVERRIDE;
+ virtual ui::TouchStatus PreHandleTouchEvent(
+ aura::Window* target,
+ aura::TouchEvent* event) OVERRIDE;
+ virtual ui::GestureStatus PreHandleGestureEvent(
+ aura::Window* target,
+ aura::GestureEvent* event) OVERRIDE;
+
+ scoped_ptr<KeyRewriterDelegate> delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(KeyRewriterEventFilter);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_WM_KEY_REWRITER_EVENT_FILTER_
« no previous file with comments | « ash/shell.cc ('k') | ash/wm/key_rewriter_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698