Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ash / system / tray / tray_event_filter.h
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.
4
5 #ifndef ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_
6 #define ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_
7
8 #include <set>
9
10 #include "base/basictypes.h"
11 #include "ui/events/event.h"
12 #include "ui/events/event_handler.h"
13
14 namespace aura {
15 class Window;
16 }
17
18 namespace ash {
19 class TrayBubbleWrapper;
20
21 // Handles events for a tray bubble.
22
23 class TrayEventFilter : public ui::EventHandler {
24  public:
25   explicit TrayEventFilter();
26   virtual ~TrayEventFilter();
27
28   void AddWrapper(TrayBubbleWrapper* wrapper);
29   void RemoveWrapper(TrayBubbleWrapper* wrapper);
30
31   // Overridden from ui::EventHandler.
32   virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
33   virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
34
35  private:
36   // Returns true if the event is handled.
37   bool ProcessLocatedEvent(ui::LocatedEvent* event);
38
39   std::set<TrayBubbleWrapper*> wrappers_;
40
41   DISALLOW_COPY_AND_ASSIGN(TrayEventFilter);
42 };
43
44 }  // namespace ash
45
46 #endif  // ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_