| 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/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 visible_notification_count - visible_small_icon_count; | 629 visible_notification_count - visible_small_icon_count; |
| 630 if (hidden_icon_count != 0) { | 630 if (hidden_icon_count != 0) { |
| 631 counter_->SetVisible(true); | 631 counter_->SetVisible(true); |
| 632 counter_->SetNotificationCount( | 632 counter_->SetNotificationCount( |
| 633 (visible_small_icon_count != 0), // small_icons_exist | 633 (visible_small_icon_count != 0), // small_icons_exist |
| 634 hidden_icon_count); | 634 hidden_icon_count); |
| 635 } else { | 635 } else { |
| 636 counter_->SetVisible(false); | 636 counter_->SetVisible(false); |
| 637 } | 637 } |
| 638 | 638 |
| 639 SetVisible(IsLoggedIn()); | 639 SetVisible(IsLoggedIn() && ShouldShowMessageCenter()); |
| 640 PreferredSizeChanged(); | 640 PreferredSizeChanged(); |
| 641 Layout(); | 641 Layout(); |
| 642 SchedulePaint(); | 642 SchedulePaint(); |
| 643 if (IsLoggedIn()) | 643 if (IsLoggedIn()) |
| 644 system_tray_->SetNextFocusableView(this); | 644 system_tray_->SetNextFocusableView(this); |
| 645 } | 645 } |
| 646 | 646 |
| 647 void WebNotificationTray::ClickedOutsideBubble() { | 647 void WebNotificationTray::ClickedOutsideBubble() { |
| 648 // Only hide the message center | 648 // Only hide the message center |
| 649 if (!message_center_bubble()) | 649 if (!message_center_bubble()) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 671 | 671 |
| 672 message_center::MessageCenterBubble* | 672 message_center::MessageCenterBubble* |
| 673 WebNotificationTray::GetMessageCenterBubbleForTest() { | 673 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 674 if (!message_center_bubble()) | 674 if (!message_center_bubble()) |
| 675 return nullptr; | 675 return nullptr; |
| 676 return static_cast<message_center::MessageCenterBubble*>( | 676 return static_cast<message_center::MessageCenterBubble*>( |
| 677 message_center_bubble()->bubble()); | 677 message_center_bubble()->bubble()); |
| 678 } | 678 } |
| 679 | 679 |
| 680 } // namespace ash | 680 } // namespace ash |
| OLD | NEW |