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

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

Issue 1918183003: mash: Close the system tray bubble on click outside its bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pointerwatcher
Patch Set: rebase Created 4 years, 8 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/system/tray/tray_background_view.h ('k') | ash/system/tray/tray_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index 86f5545bcbe75973e11cc3dfe69f6111bcecc176..9ab45d4fe4717812333a3149344e3081ee0aa2b9 100644
--- a/ash/system/tray/tray_event_filter.h
+++ b/ash/system/tray/tray_event_filter.h
@@ -8,33 +8,31 @@
#include <set>
#include "base/macros.h"
-#include "ui/events/event.h"
-#include "ui/events/event_handler.h"
+#include "ui/views/pointer_watcher.h"
-namespace aura {
-class Window;
+namespace ui {
+class LocatedEvent;
}
namespace ash {
class TrayBubbleWrapper;
-// Handles events for a tray bubble.
-
-class TrayEventFilter : public ui::EventHandler {
+// Handles events for a tray bubble, e.g. to close the system tray bubble when
+// the user clicks outside it.
+class TrayEventFilter : public views::PointerWatcher {
public:
- explicit TrayEventFilter();
+ TrayEventFilter();
~TrayEventFilter() override;
void AddWrapper(TrayBubbleWrapper* wrapper);
void RemoveWrapper(TrayBubbleWrapper* wrapper);
- // Overridden from ui::EventHandler.
- void OnMouseEvent(ui::MouseEvent* event) override;
- void OnTouchEvent(ui::TouchEvent* event) override;
+ // views::PointerWatcher:
+ void OnMousePressed(const ui::MouseEvent& event) override;
+ void OnTouchPressed(const ui::TouchEvent& event) override;
private:
- // Returns true if the event is handled.
- bool ProcessLocatedEvent(ui::LocatedEvent* event);
+ void ProcessLocatedEvent(const ui::LocatedEvent& event);
std::set<TrayBubbleWrapper*> wrappers_;
« no previous file with comments | « ash/system/tray/tray_background_view.h ('k') | ash/system/tray/tray_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698