| OLD | NEW |
| (Empty) |
| 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_COMMON_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_ | |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "ui/views/pointer_watcher.h" | |
| 12 | |
| 13 namespace gfx { | |
| 14 class Point; | |
| 15 } | |
| 16 | |
| 17 namespace ui { | |
| 18 class LocatedEvent; | |
| 19 } | |
| 20 | |
| 21 namespace ash { | |
| 22 class TrayBubbleWrapper; | |
| 23 | |
| 24 // Handles events for a tray bubble, e.g. to close the system tray bubble when | |
| 25 // the user clicks outside it. | |
| 26 class TrayEventFilter : public views::PointerWatcher { | |
| 27 public: | |
| 28 TrayEventFilter(); | |
| 29 ~TrayEventFilter() override; | |
| 30 | |
| 31 void AddWrapper(TrayBubbleWrapper* wrapper); | |
| 32 void RemoveWrapper(TrayBubbleWrapper* wrapper); | |
| 33 | |
| 34 // views::PointerWatcher: | |
| 35 void OnMousePressed(const ui::MouseEvent& event, | |
| 36 const gfx::Point& location_in_screen, | |
| 37 views::Widget* target) override; | |
| 38 void OnTouchPressed(const ui::TouchEvent& event, | |
| 39 const gfx::Point& location_in_screen, | |
| 40 views::Widget* target) override; | |
| 41 | |
| 42 private: | |
| 43 void ProcessPressedEvent(const gfx::Point& location_in_screen, | |
| 44 views::Widget* target); | |
| 45 | |
| 46 std::set<TrayBubbleWrapper*> wrappers_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(TrayEventFilter); | |
| 49 }; | |
| 50 | |
| 51 } // namespace ash | |
| 52 | |
| 53 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_ | |
| OLD | NEW |