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

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

Issue 1934123004: mash: Fix shelf overflow bubble not closing on click outside its bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2openoverflow
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_event_filter.h ('k') | ui/views/mus/window_manager_connection.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.cc
diff --git a/ash/system/tray/tray_event_filter.cc b/ash/system/tray/tray_event_filter.cc
index dd18b803aa23d155cc8721824b96c01477a0cfe7..8d2368d3a841631ab93aa8a3557ada915c1ed735 100644
--- a/ash/system/tray/tray_event_filter.cc
+++ b/ash/system/tray/tray_event_filter.cc
@@ -39,15 +39,21 @@ void TrayEventFilter::RemoveWrapper(TrayBubbleWrapper* wrapper) {
Shell::GetInstance()->RemovePointerWatcher(this);
}
-void TrayEventFilter::OnMousePressed(const ui::MouseEvent& event) {
- ProcessLocatedEvent(event);
+void TrayEventFilter::OnMousePressed(const ui::MouseEvent& event,
+ const gfx::Point& location_in_screen) {
+ ProcessLocatedEvent(event, location_in_screen);
}
-void TrayEventFilter::OnTouchPressed(const ui::TouchEvent& event) {
- ProcessLocatedEvent(event);
+void TrayEventFilter::OnTouchPressed(const ui::TouchEvent& event,
+ const gfx::Point& location_in_screen) {
+ ProcessLocatedEvent(event, location_in_screen);
}
-void TrayEventFilter::ProcessLocatedEvent(const ui::LocatedEvent& event) {
+void TrayEventFilter::ProcessLocatedEvent(
+ const ui::LocatedEvent& event,
+ const gfx::Point& location_in_screen) {
+ // TODO(jamescook): Rewrite this to avoid using event.target() as that will
+ // always be null on mus. http://crbug.com/608570
if (event.target()) {
aura::Window* target = static_cast<aura::Window*>(event.target());
// Don't process events that occurred inside an embedded menu.
@@ -78,19 +84,13 @@ void TrayEventFilter::ProcessLocatedEvent(const ui::LocatedEvent& event) {
gfx::Rect bounds = bubble_widget->GetWindowBoundsInScreen();
bounds.Inset(wrapper->bubble_view()->GetBorderInsets());
- aura::Window* root = bubble_widget->GetNativeView()->GetRootWindow();
- aura::client::ScreenPositionClient* screen_position_client =
- aura::client::GetScreenPositionClient(root);
- gfx::Point screen_point(event.root_location());
- screen_position_client->ConvertPointToScreen(root, &screen_point);
-
- if (bounds.Contains(screen_point))
+ if (bounds.Contains(location_in_screen))
return;
if (wrapper->tray()) {
// If the user clicks on the parent tray, don't process the event here,
// let the tray logic handle the event and determine show/hide behavior.
bounds = wrapper->tray()->GetBoundsInScreen();
- if (bounds.Contains(screen_point))
+ if (bounds.Contains(location_in_screen))
return;
}
}
« no previous file with comments | « ash/system/tray/tray_event_filter.h ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698