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(); |