| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 message_center_tray_.get(), | 245 message_center_tray_.get(), |
| 246 true); | 246 true); |
| 247 | 247 |
| 248 // Assume the status area and bubble bottoms are aligned when vertical. | 248 // Assume the status area and bubble bottoms are aligned when vertical. |
| 249 aura::Window* status_area_window = status_area_widget()->GetNativeView(); | 249 aura::Window* status_area_window = status_area_widget()->GetNativeView(); |
| 250 const int max_height = | 250 const int max_height = |
| 251 wm::IsHorizontalAlignment(GetShelfLayoutManager()->GetAlignment()) | 251 wm::IsHorizontalAlignment(GetShelfLayoutManager()->GetAlignment()) |
| 252 ? GetShelfLayoutManager()->GetIdealBounds().y() | 252 ? GetShelfLayoutManager()->GetIdealBounds().y() |
| 253 : status_area_window->GetBoundsInRootWindow().bottom(); | 253 : status_area_window->GetBoundsInRootWindow().bottom(); |
| 254 | 254 |
| 255 message_center_bubble->SetMaxHeight(std::max(0, max_height - kTraySpacing)); | 255 message_center_bubble->SetMaxHeight( |
| 256 std::max(0, max_height - GetTrayConstant(TRAY_SPACING))); |
| 256 if (show_settings) | 257 if (show_settings) |
| 257 message_center_bubble->SetSettingsVisible(); | 258 message_center_bubble->SetSettingsVisible(); |
| 258 message_center_bubble_.reset( | 259 message_center_bubble_.reset( |
| 259 new WebNotificationBubbleWrapper(this, message_center_bubble)); | 260 new WebNotificationBubbleWrapper(this, message_center_bubble)); |
| 260 | 261 |
| 261 status_area_widget()->SetHideSystemNotifications(true); | 262 status_area_widget()->SetHideSystemNotifications(true); |
| 262 GetShelfLayoutManager()->UpdateAutoHideState(); | 263 GetShelfLayoutManager()->UpdateAutoHideState(); |
| 263 button_->SetBubbleVisible(true); | 264 button_->SetBubbleVisible(true); |
| 264 SetDrawBackgroundAsActive(true); | 265 SetDrawBackgroundAsActive(true); |
| 265 return true; | 266 return true; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 504 |
| 504 message_center::MessageCenterBubble* | 505 message_center::MessageCenterBubble* |
| 505 WebNotificationTray::GetMessageCenterBubbleForTest() { | 506 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 506 if (!message_center_bubble()) | 507 if (!message_center_bubble()) |
| 507 return NULL; | 508 return NULL; |
| 508 return static_cast<message_center::MessageCenterBubble*>( | 509 return static_cast<message_center::MessageCenterBubble*>( |
| 509 message_center_bubble()->bubble()); | 510 message_center_bubble()->bubble()); |
| 510 } | 511 } |
| 511 | 512 |
| 512 } // namespace ash | 513 } // namespace ash |
| OLD | NEW |