OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/tray/system_tray_bubble.h" | 5 #include "ash/system/tray/system_tray_bubble.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/session/session_controller.h" | 10 #include "ash/session/session_controller.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 TrayBubbleView::InitParams* init_params) { | 190 TrayBubbleView::InitParams* init_params) { |
191 DCHECK(anchor); | 191 DCHECK(anchor); |
192 DCHECK(!bubble_view_); | 192 DCHECK(!bubble_view_); |
193 | 193 |
194 if (bubble_type_ == BUBBLE_TYPE_DETAILED && | 194 if (bubble_type_ == BUBBLE_TYPE_DETAILED && |
195 init_params->max_height < GetDetailedBubbleMaxHeight()) { | 195 init_params->max_height < GetDetailedBubbleMaxHeight()) { |
196 init_params->max_height = GetDetailedBubbleMaxHeight(); | 196 init_params->max_height = GetDetailedBubbleMaxHeight(); |
197 } | 197 } |
198 | 198 |
199 init_params->delegate = tray_; | 199 init_params->delegate = tray_; |
200 // Place the bubble on same display as this system tray. | 200 // Place the bubble on same display as this system tray if it is not on |
201 init_params->parent_window = tray_->GetBubbleWindowContainer(); | 201 // maximize mode. Otherwise, create an clipping window to hold the system |
202 // bubble. And place the clipping window on the same display as the system | |
203 // tray. | |
204 if (tray_->on_maximize_mode()) { | |
205 aura::Window* clipping_window = new aura::Window(nullptr); | |
xiyuan
2017/06/12 18:00:51
Re-use existing |clipping_window| if it has been c
minch1
2017/06/16 03:30:35
Done.
| |
206 clipping_window->Init(ui::LAYER_NOT_DRAWN); | |
207 clipping_window->layer()->SetMasksToBounds(true); | |
208 clipping_window->SetBounds(tray_->GetWorkAreaBoundsInScreen()); | |
209 tray_->GetBubbleWindowContainer()->AddChild(clipping_window); | |
210 clipping_window->Show(); | |
211 init_params->parent_window = clipping_window; | |
212 } else { | |
213 init_params->parent_window = tray_->GetBubbleWindowContainer(); | |
214 } | |
215 | |
202 init_params->anchor_view = anchor; | 216 init_params->anchor_view = anchor; |
203 bubble_view_ = new TrayBubbleView(*init_params); | 217 bubble_view_ = new TrayBubbleView(*init_params); |
204 UpdateBottomPadding(); | 218 UpdateBottomPadding(); |
205 bubble_view_->set_adjust_if_offscreen(false); | 219 bubble_view_->set_adjust_if_offscreen(false); |
206 CreateItemViews(login_status); | 220 CreateItemViews(login_status); |
207 | 221 |
208 if (bubble_view_->CanActivate()) { | 222 if (bubble_view_->CanActivate()) { |
209 bubble_view_->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 223 bubble_view_->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
210 } | 224 } |
211 } | 225 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 } | 348 } |
335 } | 349 } |
336 | 350 |
337 if (focus_view) { | 351 if (focus_view) { |
338 tray_->ActivateBubble(); | 352 tray_->ActivateBubble(); |
339 focus_view->RequestFocus(); | 353 focus_view->RequestFocus(); |
340 } | 354 } |
341 } | 355 } |
342 | 356 |
343 } // namespace ash | 357 } // namespace ash |
OLD | NEW |