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

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

Issue 2095663004: Revert of mash: Convert TrayBackgroundView to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_bubble_wrapper.cc ('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
new file mode 100644
index 0000000000000000000000000000000000000000..ceee4d30bd94b0408dc543c5f0c08f2d7a538299
--- /dev/null
+++ b/ash/system/tray/tray_event_filter.h
@@ -0,0 +1,53 @@
+// 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 <set>
+
+#include "base/macros.h"
+#include "ui/views/pointer_watcher.h"
+
+namespace gfx {
+class Point;
+}
+
+namespace ui {
+class LocatedEvent;
+}
+
+namespace ash {
+class TrayBubbleWrapper;
+
+// 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:
+ TrayEventFilter();
+ ~TrayEventFilter() override;
+
+ void AddWrapper(TrayBubbleWrapper* wrapper);
+ void RemoveWrapper(TrayBubbleWrapper* wrapper);
+
+ // views::PointerWatcher:
+ void OnMousePressed(const ui::MouseEvent& event,
+ const gfx::Point& location_in_screen,
+ views::Widget* target) override;
+ void OnTouchPressed(const ui::TouchEvent& event,
+ const gfx::Point& location_in_screen,
+ views::Widget* target) override;
+
+ private:
+ void ProcessPressedEvent(const gfx::Point& location_in_screen,
+ views::Widget* target);
+
+ std::set<TrayBubbleWrapper*> wrappers_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayEventFilter);
+};
+
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_TRAY_EVENT_FILTER_H_
« no previous file with comments | « ash/system/tray/tray_bubble_wrapper.cc ('k') | ash/system/tray/tray_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698