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

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

Issue 2930123002: Tablet WM : Swiping on system tray bubble. (Closed)
Patch Set: Fixed comments. Created 3 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/system_tray_unittest.cc ('k') | no next file » | 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 43f142b4cd7e4ee240918cf5f1d0762bdfb37538..873e7df1e7b615266e3df883a81bc2aeb2fb23d5 100644
--- a/ash/system/tray/tray_event_filter.cc
+++ b/ash/system/tray/tray_event_filter.cc
@@ -5,10 +5,12 @@
#include "ash/system/tray/tray_event_filter.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/system/tray/tray_background_view.h"
#include "ash/system/tray/tray_bubble_wrapper.h"
#include "ash/wm/container_finder.h"
+#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "ui/aura/window.h"
#include "ui/views/widget/widget.h"
@@ -73,6 +75,19 @@ void TrayEventFilter::ProcessPressedEvent(const gfx::Point& location_in_screen,
gfx::Rect bounds = bubble_widget->GetWindowBoundsInScreen();
bounds.Inset(wrapper->bubble_view()->GetBorderInsets());
+ // System tray can be dragged to show the bubble if it is in maximize mode.
+ // During the drag, the bubble's logical bounds can extend outside of the
+ // work area, but its visual bounds are only within the work area. Restrict
+ // |bounds| so that events located outside the bubble's visual bounds are
+ // treated as outside of the bubble.
+ int bubble_container_id =
+ wm::GetContainerForWindow(bubble_widget->GetNativeWindow())->id();
+ if (Shell::Get()
+ ->maximize_mode_controller()
+ ->IsMaximizeModeWindowManagerEnabled() &&
+ bubble_container_id == kShellWindowId_SettingBubbleContainer) {
+ bounds.Intersect(bubble_widget->GetWorkAreaBoundsInScreen());
+ }
if (bounds.Contains(location_in_screen))
continue;
if (wrapper->tray()) {
« no previous file with comments | « ash/system/tray/system_tray_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698