1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_
6 #define ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_
10 #include "base/basictypes.h"
11 #include "ui/events/event.h"
12 #include "ui/events/event_handler.h"
19 class TrayBubbleWrapper;
21 // Handles events for a tray bubble.
23 class TrayEventFilter : public ui::EventHandler {
25 explicit TrayEventFilter();
26 virtual ~TrayEventFilter();
28 void AddWrapper(TrayBubbleWrapper* wrapper);
29 void RemoveWrapper(TrayBubbleWrapper* wrapper);
31 // Overridden from ui::EventHandler.
32 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
33 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
36 // Returns true if the event is handled.
37 bool ProcessLocatedEvent(ui::LocatedEvent* event);
39 std::set<TrayBubbleWrapper*> wrappers_;
41 DISALLOW_COPY_AND_ASSIGN(TrayEventFilter);
46 #endif // ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_