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

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

Issue 2932033003: [Test]Swiping on system tray bubble. (Closed)
Patch Set: Remove shell observer. 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.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/system_tray_bubble.cc
diff --git a/ash/system/tray/system_tray_bubble.cc b/ash/system/tray/system_tray_bubble.cc
index bf94470ed85f0c75f6784d3d8513fc6c2e1cc0de..4f4160a4408d3e568f9846e3fb379c801e541ddb 100644
--- a/ash/system/tray/system_tray_bubble.cc
+++ b/ash/system/tray/system_tray_bubble.cc
@@ -197,8 +197,22 @@ void SystemTrayBubble::InitView(views::View* anchor,
}
init_params->delegate = tray_;
- // Place the bubble on same display as this system tray.
- init_params->parent_window = tray_->GetBubbleWindowContainer();
+ // Place the bubble on same display as this system tray if it is not on
+ // maximize mode. Otherwise, create an clipping window to hold the system
+ // bubble. And place the clipping window on the same display as the system
+ // tray.
+ if (tray_->on_maximize_mode()) {
+ aura::Window* clipping_window = new aura::Window(nullptr);
+ clipping_window->Init(ui::LAYER_NOT_DRAWN);
+ clipping_window->layer()->SetMasksToBounds(true);
+ clipping_window->SetBounds(tray_->GetWorkAreaBoundsInScreen());
+ tray_->GetBubbleWindowContainer()->AddChild(clipping_window);
+ clipping_window->Show();
+ init_params->parent_window = clipping_window;
+ } else {
+ init_params->parent_window = tray_->GetBubbleWindowContainer();
+ }
+
init_params->anchor_view = anchor;
bubble_view_ = new TrayBubbleView(*init_params);
UpdateBottomPadding();
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698