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/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_layout_manager_observer.h" | 10 #include "ash/shelf/shelf_layout_manager_observer.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 case SHELF_ALIGNMENT_RIGHT: { | 323 case SHELF_ALIGNMENT_RIGHT: { |
324 // Assume that the bottom line of the status area widget and the bubble | 324 // Assume that the bottom line of the status area widget and the bubble |
325 // are aligned. | 325 // are aligned. |
326 max_height = status_area_window->GetBoundsInRootWindow().bottom(); | 326 max_height = status_area_window->GetBoundsInRootWindow().bottom(); |
327 break; | 327 break; |
328 } | 328 } |
329 default: | 329 default: |
330 NOTREACHED(); | 330 NOTREACHED(); |
331 } | 331 } |
332 | 332 |
333 message_center_bubble->SetMaxHeight(std::max(0, max_height - kTraySpacing)); | 333 int spacing = ash::switches::UseAlternateShelfLayout() ? |
| 334 kAlternateTraySpacing : kTraySpacing; |
| 335 message_center_bubble->SetMaxHeight(std::max(0, max_height - spacing)); |
334 if (show_settings) | 336 if (show_settings) |
335 message_center_bubble->SetSettingsVisible(); | 337 message_center_bubble->SetSettingsVisible(); |
336 message_center_bubble_.reset( | 338 message_center_bubble_.reset( |
337 new internal::WebNotificationBubbleWrapper(this, message_center_bubble)); | 339 new internal::WebNotificationBubbleWrapper(this, message_center_bubble)); |
338 | 340 |
339 status_area_widget()->SetHideSystemNotifications(true); | 341 status_area_widget()->SetHideSystemNotifications(true); |
340 GetShelfLayoutManager()->UpdateAutoHideState(); | 342 GetShelfLayoutManager()->UpdateAutoHideState(); |
341 button_->SetBubbleVisible(true); | 343 button_->SetBubbleVisible(true); |
342 return true; | 344 return true; |
343 } | 345 } |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 600 |
599 message_center::MessageCenterBubble* | 601 message_center::MessageCenterBubble* |
600 WebNotificationTray::GetMessageCenterBubbleForTest() { | 602 WebNotificationTray::GetMessageCenterBubbleForTest() { |
601 if (!message_center_bubble()) | 603 if (!message_center_bubble()) |
602 return NULL; | 604 return NULL; |
603 return static_cast<message_center::MessageCenterBubble*>( | 605 return static_cast<message_center::MessageCenterBubble*>( |
604 message_center_bubble()->bubble()); | 606 message_center_bubble()->bubble()); |
605 } | 607 } |
606 | 608 |
607 } // namespace ash | 609 } // namespace ash |
OLD | NEW |