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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
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
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
OLDNEW
« 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