Chromium Code Reviews| 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..2aa49992947552039773af5179b1e26dc31ecb30 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())) { |
| + // In the horizontal case, message center starts from the top of the shelf. |
| + // In the vertical case, it starts from the bottom of WebNotificationTray. |
| + int max_height = GetBoundsInScreen().bottom(); |
| + if (IsHorizontalAlignment(shelf_alignment())) |
|
yoshiki
2017/02/02 03:25:23
nit: how about using a ternary conditional operato
Eliot Courtney
2017/02/02 03:40:07
Done.
|
| 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))); |
| + message_center_bubble->SetMaxHeight(max_height); |
| + |
| if (show_settings) |
| message_center_bubble->SetSettingsVisible(); |