Commit 9023a87c authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Fix LoginScreenControllerNoSessionTest for Unified

This CL fixes ShowSystemTrayOnPrimaryLoginScreen when UnifiedSystemTray
is enabled. A system tray should not SetVisible(true) before
UpdateAfterLoginStatusChange is called.

TEST=LoginScreenControllerNoSessionTest.ShowSystemTrayOnPrimaryLoginScreen
(--enable-features=SystemTrayUnified)
BUG=847104

Change-Id: I2ca02dd55def1385e769f00604cd42281413d8b7
Reviewed-on: https://chromium-review.googlesource.com/1088266
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564924}
parent aaa3a1dd
......@@ -168,6 +168,8 @@ void StatusAreaWidget::UpdateAfterLoginStatusChange(LoginStatus login_status) {
if (system_tray_)
system_tray_->UpdateAfterLoginStatusChange(login_status);
if (unified_system_tray_)
unified_system_tray_->UpdateAfterLoginStatusChange();
logout_button_tray_->UpdateAfterLoginStatusChange();
overview_button_tray_->UpdateAfterLoginStatusChange(login_status);
}
......
......@@ -165,7 +165,6 @@ UnifiedSystemTray::UnifiedSystemTray(Shelf* shelf)
SetInkDropMode(InkDropMode::ON);
set_separator_visibility(false);
SetVisible(true);
}
UnifiedSystemTray::~UnifiedSystemTray() {
......@@ -188,6 +187,11 @@ gfx::Rect UnifiedSystemTray::GetBubbleBoundsInScreen() const {
return bubble_ ? bubble_->GetBoundsInScreen() : gfx::Rect();
}
void UnifiedSystemTray::UpdateAfterLoginStatusChange() {
SetVisible(true);
PreferredSizeChanged();
}
bool UnifiedSystemTray::PerformAction(const ui::Event& event) {
if (bubble_)
CloseBubble();
......
......@@ -47,6 +47,9 @@ class ASH_EXPORT UnifiedSystemTray : public TrayBackgroundView {
// Return the bounds of the bubble in the screen.
gfx::Rect GetBubbleBoundsInScreen() const;
// Updates when the login status of the system changes.
void UpdateAfterLoginStatusChange();
// TrayBackgroundView:
bool PerformAction(const ui::Event& event) override;
void ShowBubble(bool show_by_click) override;
......
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