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

Side by Side Diff: ash/common/system/web_notification/web_notification_tray.cc

Issue 2602143002: CrOS - Fix position of notification bubble for lock screen. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | 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/common/system/web_notification/web_notification_tray.h" 5 #include "ash/common/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/shelf/shelf_constants.h" 9 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 max_height = bounds_in_root.bottom(); 372 max_height = bounds_in_root.bottom();
373 } 373 }
374 message_center_bubble->SetMaxHeight( 374 message_center_bubble->SetMaxHeight(
375 std::max(0, max_height - GetTrayConstant(TRAY_SPACING))); 375 std::max(0, max_height - GetTrayConstant(TRAY_SPACING)));
376 if (show_settings) 376 if (show_settings)
377 message_center_bubble->SetSettingsVisible(); 377 message_center_bubble->SetSettingsVisible();
378 378
379 // For vertical shelf alignments, anchor to the WebNotificationTray, but for 379 // For vertical shelf alignments, anchor to the WebNotificationTray, but for
380 // horizontal (i.e. bottom) shelves, anchor to the system tray. 380 // horizontal (i.e. bottom) shelves, anchor to the system tray.
381 TrayBackgroundView* anchor_tray = this; 381 TrayBackgroundView* anchor_tray = this;
382 if (shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) { 382 if (IsHorizontalAlignment(shelf_alignment())) {
383 anchor_tray = WmShelf::ForWindow(status_area_window_) 383 anchor_tray = WmShelf::ForWindow(status_area_window_)
384 ->GetStatusAreaWidget() 384 ->GetStatusAreaWidget()
385 ->system_tray(); 385 ->system_tray();
386 } 386 }
387 387
388 message_center_bubble_.reset(new WebNotificationBubbleWrapper( 388 message_center_bubble_.reset(new WebNotificationBubbleWrapper(
389 this, anchor_tray, message_center_bubble)); 389 this, anchor_tray, message_center_bubble));
390 390
391 system_tray_->SetHideNotifications(true); 391 system_tray_->SetHideNotifications(true);
392 shelf()->UpdateAutoHideState(); 392 shelf()->UpdateAutoHideState();
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 671
672 message_center::MessageCenterBubble* 672 message_center::MessageCenterBubble*
673 WebNotificationTray::GetMessageCenterBubbleForTest() { 673 WebNotificationTray::GetMessageCenterBubbleForTest() {
674 if (!message_center_bubble()) 674 if (!message_center_bubble())
675 return nullptr; 675 return nullptr;
676 return static_cast<message_center::MessageCenterBubble*>( 676 return static_cast<message_center::MessageCenterBubble*>(
677 message_center_bubble()->bubble()); 677 message_center_bubble()->bubble());
678 } 678 }
679 679
680 } // namespace ash 680 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698