| 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/common/system/web_notification/web_notification_tray.h" | 5 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/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/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 if (!IsMessageCenterBubbleVisible()) | 338 if (!IsMessageCenterBubbleVisible()) |
| 339 message_center_tray_->ShowMessageCenterBubble(); | 339 message_center_tray_->ShowMessageCenterBubble(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void WebNotificationTray::UpdateAfterLoginStatusChange( | 342 void WebNotificationTray::UpdateAfterLoginStatusChange( |
| 343 LoginStatus login_status) { | 343 LoginStatus login_status) { |
| 344 message_center()->SetLockedState(login_status == LoginStatus::LOCKED); | 344 message_center()->SetLockedState(login_status == LoginStatus::LOCKED); |
| 345 OnMessageCenterTrayChanged(); | 345 OnMessageCenterTrayChanged(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { | 348 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment, |
| 349 const gfx::Insets& insets) { |
| 349 if (alignment == shelf_alignment()) | 350 if (alignment == shelf_alignment()) |
| 350 return; | 351 return; |
| 351 TrayBackgroundView::SetShelfAlignment(alignment); | 352 TrayBackgroundView::SetShelfAlignment(alignment, insets); |
| 352 tray_container()->SetBorder(views::Border::NullBorder()); | 353 tray_container()->SetBorder(views::Border::NullBorder()); |
| 353 // Destroy any existing bubble so that it will be rebuilt correctly. | 354 // Destroy any existing bubble so that it will be rebuilt correctly. |
| 354 message_center_tray_->HideMessageCenterBubble(); | 355 message_center_tray_->HideMessageCenterBubble(); |
| 355 message_center_tray_->HidePopupBubble(); | 356 message_center_tray_->HidePopupBubble(); |
| 356 } | 357 } |
| 357 | 358 |
| 358 void WebNotificationTray::AnchorUpdated() { | 359 void WebNotificationTray::AnchorUpdated() { |
| 359 if (message_center_bubble()) { | 360 if (message_center_bubble()) { |
| 360 message_center_bubble()->bubble_view()->UpdateBubble(); | 361 message_center_bubble()->bubble_view()->UpdateBubble(); |
| 361 UpdateBubbleViewArrow(message_center_bubble()->bubble_view()); | 362 UpdateBubbleViewArrow(message_center_bubble()->bubble_view()); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 531 |
| 531 message_center::MessageCenterBubble* | 532 message_center::MessageCenterBubble* |
| 532 WebNotificationTray::GetMessageCenterBubbleForTest() { | 533 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 533 if (!message_center_bubble()) | 534 if (!message_center_bubble()) |
| 534 return NULL; | 535 return NULL; |
| 535 return static_cast<message_center::MessageCenterBubble*>( | 536 return static_cast<message_center::MessageCenterBubble*>( |
| 536 message_center_bubble()->bubble()); | 537 message_center_bubble()->bubble()); |
| 537 } | 538 } |
| 538 | 539 |
| 539 } // namespace ash | 540 } // namespace ash |
| OLD | NEW |