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

Unified Diff: ash/common/system/web_notification/web_notification_tray.cc

Issue 2668033004: [ash] Fix message center maximum height for vertical shelf alignments. (Closed)
Patch Set: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/web_notification/web_notification_tray.cc
diff --git a/ash/common/system/web_notification/web_notification_tray.cc b/ash/common/system/web_notification/web_notification_tray.cc
index ce82103006259a23d801fdf220ccd162e0fcdbdf..7999f51bc20037d33046b4bff1ec986e276a99f2 100644
--- a/ash/common/system/web_notification/web_notification_tray.cc
+++ b/ash/common/system/web_notification/web_notification_tray.cc
@@ -357,18 +357,13 @@ bool WebNotificationTray::ShowMessageCenterInternal(bool show_settings) {
new message_center::MessageCenterBubble(message_center(),
message_center_tray_.get());
- int max_height;
- if (IsHorizontalAlignment(shelf_alignment())) {
- max_height = shelf()->GetIdealBounds().y();
- } else {
- // Assume the status area and bubble bottoms are aligned when vertical.
- gfx::Rect bounds_in_root =
- status_area_window_->GetRootWindow()->ConvertRectFromScreen(
- status_area_window_->GetBoundsInScreen());
- max_height = bounds_in_root.bottom();
- }
- message_center_bubble->SetMaxHeight(
- std::max(0, max_height - GetTrayConstant(TRAY_SPACING)));
+ // In the horizontal case, message center starts from the top of the shelf.
+ // In the vertical case, it starts from the bottom of WebNotificationTray.
+ const int max_height = IsHorizontalAlignment(shelf_alignment())
+ ? shelf()->GetIdealBounds().y()
+ : GetBoundsInScreen().bottom();
+ message_center_bubble->SetMaxHeight(max_height);
+
if (show_settings)
message_center_bubble->SetSettingsVisible();
« 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