Commit 3767b2ad authored by Yoshiki Iguchi's avatar Yoshiki Iguchi Committed by Commit Bot

Revert "Show notification counter even on lock screen"

This reverts commit 155c0b00.

Reason for revert: This breaks the lock screen notification.

Original change's description:
> Show notification counter even on lock screen
> 
> - Unblock notifications in SessionStateNotificationBlocker
> - Hide the message center by seeing the session sate (previously, it
>   saw the count of notifications)
> - Change height below scroll, by checking the visibility of message
>   center (previously, it checked only the height)
> 
> Bug: 893945
> Test: manual
> 
> Change-Id: I39d30d0949d0f44078193ab7e4859f66eeebf880
> Reviewed-on: https://chromium-review.googlesource.com/c/1282426
> Reviewed-by: Tatsuhisa Yamaguchi <yamaguchi@chromium.org>
> Reviewed-by: Tetsui Ohkubo <tetsui@chromium.org>
> Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#601824}

TBR=yoshiki@chromium.org,yamaguchi@chromium.org,tetsui@chromium.org

Change-Id: I5b2ded9c9f3212ab3cd085a3ea0721e69b6fae45
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 893945
Reviewed-on: https://chromium-review.googlesource.com/c/1296330Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601930}
parent 3c31c9cf
......@@ -193,10 +193,6 @@ void NewUnifiedMessageCenterView::OnDidChangeFocus(views::View* before,
void NewUnifiedMessageCenterView::SetNotificationHeightBelowScroll(
int height_below_scroll) {
// |parent_| may be null on test.
if (!parent_)
return;
parent_->SetNotificationHeightBelowScroll(height_below_scroll);
}
......@@ -205,9 +201,6 @@ void NewUnifiedMessageCenterView::UpdateVisibility() {
SetVisible(message_list_view_->GetPreferredSize().height() > 0 &&
session_controller->ShouldShowNotificationTray() &&
!session_controller->IsScreenLocked());
NotifyHeightBelowScroll();
// When notification list went invisible, |position_from_bottom_| should be
// reset.
if (!visible())
......@@ -252,11 +245,8 @@ int NewUnifiedMessageCenterView::GetStackedNotificationCount() const {
}
void NewUnifiedMessageCenterView::NotifyHeightBelowScroll() {
int height_below_scroll =
(visible() ? std::max(0, message_list_view_->height() -
scroller_->GetVisibleRect().bottom())
: 0);
SetNotificationHeightBelowScroll(height_below_scroll);
SetNotificationHeightBelowScroll(std::max(
0, message_list_view_->height() - scroller_->GetVisibleRect().bottom()));
}
} // namespace ash
......@@ -19,7 +19,9 @@ bool CalculateShouldShowNotification() {
SessionController* const session_controller =
Shell::Get()->session_controller();
return !session_controller->IsRunningInAppMode();
return !session_controller->IsRunningInAppMode() &&
(!session_controller->IsScreenLocked() ||
AshMessageCenterLockScreenController::IsEnabled());
}
bool CalculateShouldShowPopup() {
......
......@@ -4,8 +4,6 @@
#include "ash/system/message_center/unified_message_center_view.h"
#include "ash/session/session_controller.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/system/message_center/message_center_scroll_bar.h"
#include "ash/system/unified/sign_out_button.h"
......@@ -303,19 +301,14 @@ void UnifiedMessageCenterView::OnMessageCenterScrolled() {
}
void UnifiedMessageCenterView::NotifyHeightBelowScroll() {
int height_below_scroll =
(visible() ? message_list_view_->GetHeightBelowVisibleRect() : 0);
parent_->SetNotificationHeightBelowScroll(height_below_scroll);
parent_->SetNotificationHeightBelowScroll(
message_list_view_->GetHeightBelowVisibleRect());
}
void UnifiedMessageCenterView::Update() {
SessionController* session_controller = Shell::Get()->session_controller();
SetVisible(message_list_view_->GetNotificationCount() > 0 &&
!session_controller->IsScreenLocked());
if (GetWidget() && !GetWidget()->IsClosed()) {
NotifyHeightBelowScroll();
SetVisible(message_list_view_->GetNotificationCount() > 0);
if (GetWidget() && !GetWidget()->IsClosed())
tray_controller_->OnMessageCenterVisibilityUpdated();
}
size_t notification_count = message_list_view_->GetNotificationCount();
// TODO(tetsui): This is O(n^2).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment