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

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

Issue 2330403002: Do not activate system tray bubble by default (Closed)
Patch Set: Do not activate system tray bubble by default Created 4 years, 3 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/common/system/tray/tray_background_view.cc ('k') | ash/common/system/tray/tray_item_more.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_event_filter.cc
diff --git a/ash/common/system/tray/tray_event_filter.cc b/ash/common/system/tray/tray_event_filter.cc
index 65f4d8a115be45cf2fc9d33a9fd9947e439a8e23..29c1475b296f1b0c1044701805a4a92f8bd9b248 100644
--- a/ash/common/system/tray/tray_event_filter.cc
+++ b/ash/common/system/tray/tray_event_filter.cc
@@ -53,12 +53,16 @@ void TrayEventFilter::ProcessPressedEvent(const gfx::Point& location_in_screen,
// the right-click menu in a popup notification.
if (container_id == kShellWindowId_MenuContainer)
return;
- // Don't process events that occurred inside the status area widget and
- // a popup notification from message center.
- if (container_id == kShellWindowId_StatusContainer)
+ // Don't process events that occurred inside a popup notification
+ // from message center.
+ if (container_id == kShellWindowId_StatusContainer &&
+ window->GetType() == ui::wm::WINDOW_TYPE_POPUP &&
+ target->IsAlwaysOnTop()) {
return;
+ }
}
+ std::set<TrayBackgroundView*> trays;
// Check the boundary for all wrappers, and do not handle the event if it
// happens inside of any of those wrappers.
for (std::set<TrayBubbleWrapper*>::const_iterator iter = wrappers_.begin();
@@ -71,24 +75,19 @@ void TrayEventFilter::ProcessPressedEvent(const gfx::Point& location_in_screen,
gfx::Rect bounds = bubble_widget->GetWindowBoundsInScreen();
bounds.Inset(wrapper->bubble_view()->GetBorderInsets());
if (bounds.Contains(location_in_screen))
- return;
+ continue;
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(location_in_screen))
- return;
+ continue;
}
- }
-
- // Handle clicking outside the bubble and tray.
- // Cannot iterate |wrappers_| directly, because clicking outside will remove
- // the wrapper, which shrinks |wrappers_| unsafely.
- std::set<TrayBackgroundView*> trays;
- for (std::set<TrayBubbleWrapper*>::iterator iter = wrappers_.begin();
- iter != wrappers_.end(); ++iter) {
trays.insert((*iter)->tray());
}
+
+ // Close all bubbles other than the one a user clicked on the tray
+ // or its bubble.
for (std::set<TrayBackgroundView*>::iterator iter = trays.begin();
iter != trays.end(); ++iter) {
(*iter)->ClickedOutsideBubble();
« no previous file with comments | « ash/common/system/tray/tray_background_view.cc ('k') | ash/common/system/tray/tray_item_more.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698