| 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/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 10 #include "ash/common/shelf/wm_shelf_util.h" | 10 #include "ash/common/shelf/wm_shelf_util.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 max_height = GetShelfLayoutManager()->GetIdealBounds().y(); | 263 max_height = GetShelfLayoutManager()->GetIdealBounds().y(); |
| 264 } else { | 264 } else { |
| 265 // Assume the status area and bubble bottoms are aligned when vertical. | 265 // Assume the status area and bubble bottoms are aligned when vertical. |
| 266 WmWindow* status_area_window = | 266 WmWindow* status_area_window = |
| 267 WmLookup::Get()->GetWindowForWidget(status_area_widget()); | 267 WmLookup::Get()->GetWindowForWidget(status_area_widget()); |
| 268 gfx::Rect bounds_in_root = | 268 gfx::Rect bounds_in_root = |
| 269 status_area_window->GetRootWindow()->ConvertRectFromScreen( | 269 status_area_window->GetRootWindow()->ConvertRectFromScreen( |
| 270 status_area_window->GetBoundsInScreen()); | 270 status_area_window->GetBoundsInScreen()); |
| 271 max_height = bounds_in_root.bottom(); | 271 max_height = bounds_in_root.bottom(); |
| 272 } | 272 } |
| 273 message_center_bubble->SetMaxHeight(std::max(0, max_height - kTraySpacing)); | 273 message_center_bubble->SetMaxHeight( |
| 274 std::max(0, max_height - GetTrayConstant(TRAY_SPACING))); |
| 274 if (show_settings) | 275 if (show_settings) |
| 275 message_center_bubble->SetSettingsVisible(); | 276 message_center_bubble->SetSettingsVisible(); |
| 276 message_center_bubble_.reset( | 277 message_center_bubble_.reset( |
| 277 new WebNotificationBubbleWrapper(this, message_center_bubble)); | 278 new WebNotificationBubbleWrapper(this, message_center_bubble)); |
| 278 | 279 |
| 279 status_area_widget()->SetHideSystemNotifications(true); | 280 status_area_widget()->SetHideSystemNotifications(true); |
| 280 GetShelfLayoutManager()->UpdateAutoHideState(); | 281 GetShelfLayoutManager()->UpdateAutoHideState(); |
| 281 button_->SetBubbleVisible(true); | 282 button_->SetBubbleVisible(true); |
| 282 SetDrawBackgroundAsActive(true); | 283 SetDrawBackgroundAsActive(true); |
| 283 return true; | 284 return true; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 525 |
| 525 message_center::MessageCenterBubble* | 526 message_center::MessageCenterBubble* |
| 526 WebNotificationTray::GetMessageCenterBubbleForTest() { | 527 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 527 if (!message_center_bubble()) | 528 if (!message_center_bubble()) |
| 528 return NULL; | 529 return NULL; |
| 529 return static_cast<message_center::MessageCenterBubble*>( | 530 return static_cast<message_center::MessageCenterBubble*>( |
| 530 message_center_bubble()->bubble()); | 531 message_center_bubble()->bubble()); |
| 531 } | 532 } |
| 532 | 533 |
| 533 } // namespace ash | 534 } // namespace ash |
| OLD | NEW |