Commit 2e9d16cd authored by yilkal's avatar yilkal Committed by Commit Bot

Remove KioskNext from TopShortcutsView.

Bug: 977019
Change-Id: Ia3d06b9e43b969540435269ea047816f7bf1521a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1684592
Commit-Queue: Yilkal Abe <yilkal@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676127}
parent 8bdf10df
......@@ -7,7 +7,6 @@
#include <numeric>
#include "ash/accessibility/accessibility_controller_impl.h"
#include "ash/kiosk_next/kiosk_next_shell_controller_impl.h"
#include "ash/public/cpp/ash_view_ids.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/session/session_controller_impl.h"
......@@ -171,7 +170,6 @@ TopShortcutsView::TopShortcutsView(UnifiedSystemTrayController* controller)
bool is_on_login_screen =
shell->session_controller()->login_status() == LoginStatus::NOT_LOGGED_IN;
bool is_kiosk_next = shell->kiosk_next_shell_controller()->IsEnabled();
bool can_show_settings = TrayPopupUtils::CanOpenWebUISettings();
bool can_lock_screen = shell->session_controller()->CanLockScreen();
......@@ -185,16 +183,14 @@ TopShortcutsView::TopShortcutsView(UnifiedSystemTrayController* controller)
container_->AddSignOutButton(sign_out_button_);
}
if (!is_kiosk_next) {
bool reboot = shell->shutdown_controller()->reboot_on_shutdown();
power_button_ = new TopShortcutButton(
this, kUnifiedMenuPowerIcon,
reboot ? IDS_ASH_STATUS_TRAY_REBOOT : IDS_ASH_STATUS_TRAY_SHUTDOWN);
power_button_->SetID(VIEW_ID_POWER_BUTTON);
container_->AddChildView(power_button_);
}
bool reboot = shell->shutdown_controller()->reboot_on_shutdown();
power_button_ = new TopShortcutButton(
this, kUnifiedMenuPowerIcon,
reboot ? IDS_ASH_STATUS_TRAY_REBOOT : IDS_ASH_STATUS_TRAY_SHUTDOWN);
power_button_->SetID(VIEW_ID_POWER_BUTTON);
container_->AddChildView(power_button_);
if (can_show_settings && can_lock_screen && !is_kiosk_next) {
if (can_show_settings && can_lock_screen) {
lock_button_ = new TopShortcutButton(this, kUnifiedMenuLockIcon,
IDS_ASH_STATUS_TRAY_LOCK);
container_->AddChildView(lock_button_);
......
......@@ -4,9 +4,6 @@
#include "ash/system/unified/top_shortcuts_view.h"
#include "ash/kiosk_next/kiosk_next_shell_test_util.h"
#include "ash/kiosk_next/mock_kiosk_next_shell_client.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/session/test_session_controller_client.h"
#include "ash/system/unified/collapse_button.h"
#include "ash/system/unified/sign_out_button.h"
......@@ -15,7 +12,6 @@
#include "ash/system/unified/unified_system_tray_model.h"
#include "ash/test/ash_test_base.h"
#include "base/macros.h"
#include "base/test/scoped_feature_list.h"
namespace ash {
......@@ -26,8 +22,6 @@ class TopShortcutsViewTest : public NoSessionAshTestBase {
~TopShortcutsViewTest() override = default;
void SetUp() override {
scoped_feature_list_.InitAndEnableFeature(features::kKioskNextShell);
NoSessionAshTestBase::SetUp();
model_ = std::make_unique<UnifiedSystemTrayModel>();
......@@ -35,7 +29,6 @@ class TopShortcutsViewTest : public NoSessionAshTestBase {
}
void TearDown() override {
kiosk_next_shell_client_.reset();
controller_.reset();
top_shortcuts_view_.reset();
model_.reset();
......@@ -47,11 +40,6 @@ class TopShortcutsViewTest : public NoSessionAshTestBase {
top_shortcuts_view_ = std::make_unique<TopShortcutsView>(controller_.get());
}
void CreateKioskNextSession() {
kiosk_next_shell_client_ = std::make_unique<MockKioskNextShellClient>();
LogInKioskNextUser(GetSessionControllerClient());
}
views::View* GetUserAvatar() {
return top_shortcuts_view_->user_avatar_button_;
}
......@@ -75,9 +63,6 @@ class TopShortcutsViewTest : public NoSessionAshTestBase {
void Layout() { top_shortcuts_view_->Layout(); }
private:
base::test::ScopedFeatureList scoped_feature_list_;
std::unique_ptr<MockKioskNextShellClient> kiosk_next_shell_client_;
std::unique_ptr<UnifiedSystemTrayModel> model_;
std::unique_ptr<UnifiedSystemTrayController> controller_;
std::unique_ptr<TopShortcutsView> top_shortcuts_view_;
......@@ -187,29 +172,4 @@ TEST_F(TopShortcutsViewTest, ButtonLayoutSupervisedUserFlow) {
Layout();
}
// Some buttons are hidden in Kiosk Next sessions.
TEST_F(TopShortcutsViewTest, ButtonStatesKioskNextLoggedIn) {
CreateKioskNextSession();
SetUpView();
EXPECT_TRUE(GetUserAvatar()->GetVisible());
EXPECT_TRUE(GetSignOutButton()->GetVisible());
EXPECT_EQ(nullptr, GetLockButton());
EXPECT_TRUE(GetSettingsButton()->GetVisible());
EXPECT_EQ(nullptr, GetPowerButton());
EXPECT_TRUE(GetCollapseButton()->GetVisible());
}
// Settings button is also hidden at the lock screen in Kiosk Next sessions.
TEST_F(TopShortcutsViewTest, ButtonStatesKioskNextLockScreen) {
CreateKioskNextSession();
GetSessionControllerClient()->LockScreen();
SetUpView();
EXPECT_TRUE(GetUserAvatar()->GetVisible());
EXPECT_TRUE(GetSignOutButton()->GetVisible());
EXPECT_EQ(nullptr, GetLockButton());
EXPECT_EQ(nullptr, GetSettingsButton());
EXPECT_EQ(nullptr, GetPowerButton());
EXPECT_TRUE(GetCollapseButton()->GetVisible());
}
} // namespace ash
......@@ -4,7 +4,6 @@
#include "ash/system/unified/unified_system_tray_controller.h"
#include "ash/kiosk_next/kiosk_next_shell_controller_impl.h"
#include "ash/metrics/user_metrics_action.h"
#include "ash/metrics/user_metrics_recorder.h"
#include "ash/public/cpp/pagination/pagination_controller.h"
......@@ -332,10 +331,6 @@ void UnifiedSystemTrayController::OnAudioSettingsButtonClicked() {
}
void UnifiedSystemTrayController::InitFeaturePods() {
// No feature pods in Kisok Next.
if (Shell::Get()->kiosk_next_shell_controller()->IsEnabled())
return;
AddFeaturePodItem(std::make_unique<NetworkFeaturePodController>(this));
AddFeaturePodItem(std::make_unique<BluetoothFeaturePodController>(this));
AddFeaturePodItem(std::make_unique<QuietModeFeaturePodController>(this));
......
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