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

Unified Diff: ash/system/tray/tray_event_filter.h

Issue 11028134: Re-factor Ash Message Center code part 2/4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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
Index: ash/system/tray/tray_event_filter.h
diff --git a/ash/system/tray/tray_event_filter.h b/ash/system/tray/tray_event_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac2fbf6b06cb6578630122bd4473463947c41b1a
--- /dev/null
+++ b/ash/system/tray/tray_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_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_
+#define ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_
+
+#include "base/basictypes.h"
+#include "ui/aura/event_filter.h"
+#include "ui/base/events/event.h"
+
+namespace aura {
+class Window;
+}
+
+namespace ash {
+namespace internal {
+
+class TrayBubbleWrapper;
+
+class TrayEventFilter : public aura::EventFilter {
+ public:
+ explicit TrayEventFilter(TrayBubbleWrapper* wrapper);
+ virtual ~TrayEventFilter();
+
+ // Overridden from aura::EventFilter.
+ virtual bool PreHandleKeyEvent(aura::Window* target,
+ ui::KeyEvent* event) OVERRIDE;
+ virtual bool PreHandleMouseEvent(aura::Window* target,
+ ui::MouseEvent* event) OVERRIDE;
+ virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target,
+ ui::TouchEvent* event) OVERRIDE;
+ virtual ui::EventResult PreHandleGestureEvent(
+ aura::Window* target,
+ ui::GestureEvent* event) OVERRIDE;
+
+ private:
+ // Returns true if the event is handled.
+ bool ProcessLocatedEvent(aura::Window* target,
+ const ui::LocatedEvent& event);
+
+ TrayBubbleWrapper* wrapper_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayEventFilter);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698