Commit 0302b7bf authored by Thomas Tellier's avatar Thomas Tellier Committed by Commit Bot

Revert "Show enterprise disclosure as a bottom status indicator in login/lock screen"

This reverts commit c7743509.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1052316#c19

Original change's description:
> Show enterprise disclosure as a bottom status indicator in login/lock screen
>
> Bug: 1015746
> Change-Id: I995eb65b7f99f47a9f2ec5bd33798ee74fb78699
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1929813
> Commit-Queue: Thomas Tellier <tellier@google.com>
> Reviewed-by: Roman Aleksandrov <raleksandrov@google.com>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#718850}

TBR=xiyuan@chromium.org,rsorokin@chromium.org,raleksandrov@google.com,tellier@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1015746
Change-Id: I2694ddd0eb17d23d47789e3910d974b6ab8bf542
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148737Reviewed-by: default avatarThomas Tellier <tellier@google.com>
Commit-Queue: Thomas Tellier <tellier@google.com>
Cr-Commit-Position: refs/heads/master@{#758842}
parent 21c12d22
...@@ -1862,9 +1862,6 @@ This file contains the strings for ash. ...@@ -1862,9 +1862,6 @@ This file contains the strings for ash.
<message name="IDS_ASH_PIN_KEYBOARD_DELETE_ACCESSIBLE_NAME" desc="Text to be spoken when the focus is set to the delete button of the PIN keyboard."> <message name="IDS_ASH_PIN_KEYBOARD_DELETE_ACCESSIBLE_NAME" desc="Text to be spoken when the focus is set to the delete button of the PIN keyboard.">
Delete Delete
</message> </message>
<message name="IDS_ASH_LOGIN_MANAGED_DEVICE_INDICATOR" desc="Template for text shown as a bottom status on the login screen, informing the user that this device is managed.">
<ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> managed by <ph name="DOMAIN">$2<ex>yourdomain.com</ex></ph>
</message>
<message name="IDS_ASH_LOGIN_POD_OWNER_USER" desc="Login/lock screen user pod menu title for a user who owns the device."> <message name="IDS_ASH_LOGIN_POD_OWNER_USER" desc="Login/lock screen user pod menu title for a user who owns the device.">
<ph name="USER_NAME">$1<ex>Ivan Arbuzov</ex></ph> (owner) <ph name="USER_NAME">$1<ex>Ivan Arbuzov</ex></ph> (owner)
</message> </message>
......
c65621e3e10bd49f7ac4356d7c3dc5763d542be8
\ No newline at end of file
...@@ -24,7 +24,6 @@ class BottomStatusIndicator : public views::View { ...@@ -24,7 +24,6 @@ class BottomStatusIndicator : public views::View {
public: public:
enum class ContentType { enum class ContentType {
kNone, kNone,
kManagedDevice,
kAdbSideLoadingEnabled, kAdbSideLoadingEnabled,
}; };
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/system/model/enterprise_domain_model.h"
#include "ash/system/model/system_tray_model.h"
#include "ash/system/power/power_button_controller.h" #include "ash/system/power/power_button_controller.h"
#include "ash/system/status_area_widget.h" #include "ash/system/status_area_widget.h"
#include "ash/system/status_area_widget_delegate.h" #include "ash/system/status_area_widget_delegate.h"
...@@ -60,7 +58,6 @@ ...@@ -60,7 +58,6 @@
#include "ui/chromeos/devicetype_utils.h" #include "ui/chromeos/devicetype_utils.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/display/manager/display_manager.h" #include "ui/display/manager/display_manager.h"
#include "ui/display/manager/managed_display_info.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
...@@ -507,13 +504,6 @@ LockContentsView::LockContentsView( ...@@ -507,13 +504,6 @@ LockContentsView::LockContentsView(
std::move(bottom_status_indicator_layout)); std::move(bottom_status_indicator_layout));
AddChildView(bottom_status_indicator_); AddChildView(bottom_status_indicator_);
std::string entreprise_domain_name = Shell::Get()
->system_tray_model()
->enterprise_domain()
->enterprise_display_domain();
if (!entreprise_domain_name.empty())
ShowEntrepriseDomainName(entreprise_domain_name);
note_action_ = new NoteActionLaunchButton(initial_note_action_state); note_action_ = new NoteActionLaunchButton(initial_note_action_state);
top_header_->AddChildView(note_action_); top_header_->AddChildView(note_action_);
...@@ -642,21 +632,6 @@ void LockContentsView::FocusPreviousUser() { ...@@ -642,21 +632,6 @@ void LockContentsView::FocusPreviousUser() {
} }
} }
void LockContentsView::ShowEntrepriseDomainName(
const std::string& entreprise_domain_name) {
bottom_status_indicator_->SetIcon(
kLoginScreenEnterpriseIcon,
AshColorProvider::ContentLayerType::kIconPrimary);
bottom_status_indicator_->SetText(
l10n_util::GetStringFUTF16(IDS_ASH_LOGIN_MANAGED_DEVICE_INDICATOR,
ui::GetChromeOSDeviceName(),
base::UTF8ToUTF16(entreprise_domain_name)),
gfx::kGoogleGrey200);
bottom_status_indicator_->set_content_type(
BottomStatusIndicator::ContentType::kManagedDevice);
UpdateBottomStatusIndicatorVisibility();
}
void LockContentsView::ShowAdbEnabled() { void LockContentsView::ShowAdbEnabled() {
bottom_status_indicator_->SetIcon( bottom_status_indicator_->SetIcon(
kLockScreenAlertIcon, AshColorProvider::ContentLayerType::kIconRed); kLockScreenAlertIcon, AshColorProvider::ContentLayerType::kIconRed);
...@@ -2146,12 +2121,8 @@ bool LockContentsView::GetSystemInfoVisibility() const { ...@@ -2146,12 +2121,8 @@ bool LockContentsView::GetSystemInfoVisibility() const {
} }
void LockContentsView::UpdateBottomStatusIndicatorVisibility() { void LockContentsView::UpdateBottomStatusIndicatorVisibility() {
bool visible = bool visible = bottom_status_indicator_->content_type() ==
bottom_status_indicator_->content_type() == BottomStatusIndicator::ContentType::kAdbSideLoadingEnabled;
BottomStatusIndicator::ContentType::kAdbSideLoadingEnabled ||
(bottom_status_indicator_->content_type() ==
BottomStatusIndicator::ContentType::kManagedDevice &&
!extension_ui_visible_);
bottom_status_indicator_->SetVisible(visible); bottom_status_indicator_->SetVisible(visible);
} }
......
...@@ -139,7 +139,6 @@ class ASH_EXPORT LockContentsView ...@@ -139,7 +139,6 @@ class ASH_EXPORT LockContentsView
void FocusNextUser(); void FocusNextUser();
void FocusPreviousUser(); void FocusPreviousUser();
void ShowEntrepriseDomainName(const std::string& entreprise_domain_name);
void ShowAdbEnabled(); void ShowAdbEnabled();
void ShowSystemInfo(); void ShowSystemInfo();
void ShowParentAccessDialog(); void ShowParentAccessDialog();
...@@ -285,8 +284,7 @@ class ASH_EXPORT LockContentsView ...@@ -285,8 +284,7 @@ class ASH_EXPORT LockContentsView
void LayoutTopHeader(); void LayoutTopHeader();
// Lay out the bottom status indicator. This is called when system information // Lay out the bottom status indicator. This is called when system information
// is shown if ADB is enabled and at the initialization of lock screen if the // is shown if ADB is enabled.
// device is enrolled.
void LayoutBottomStatusIndicator(); void LayoutBottomStatusIndicator();
// Lay out the expanded public session view. // Lay out the expanded public session view.
...@@ -443,7 +441,7 @@ class ASH_EXPORT LockContentsView ...@@ -443,7 +441,7 @@ class ASH_EXPORT LockContentsView
// Bubble for displaying supervised user deprecation message. // Bubble for displaying supervised user deprecation message.
LoginErrorBubble* supervised_user_deprecation_bubble_; LoginErrorBubble* supervised_user_deprecation_bubble_;
// Bottom status indicator displaying entreprise domain or ADB enabled alert // Bottom status indicator displaying ADB enabled alert.
BottomStatusIndicator* bottom_status_indicator_; BottomStatusIndicator* bottom_status_indicator_;
// Tracks the visibility of the extension Ui window. // Tracks the visibility of the extension Ui window.
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "ash/shelf/shelf_navigation_widget.h" #include "ash/shelf/shelf_navigation_widget.h"
#include "ash/shelf/shelf_widget.h" #include "ash/shelf/shelf_widget.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/model/system_tray_model.h"
#include "ash/system/power/backlights_forced_off_setter.h" #include "ash/system/power/backlights_forced_off_setter.h"
#include "ash/system/power/power_button_controller.h" #include "ash/system/power/power_button_controller.h"
#include "ash/system/status_area_widget.h" #include "ash/system/status_area_widget.h"
...@@ -716,8 +715,8 @@ TEST_F(LockContentsViewUnitTest, SystemInfoViewBounds) { ...@@ -716,8 +715,8 @@ TEST_F(LockContentsViewUnitTest, SystemInfoViewBounds) {
test_api.system_info()->GetBoundsInScreen().right(), test_api.system_info()->GetBoundsInScreen().right(),
note_action_size.width()); note_action_size.width());
// Verify that bottom status indicator is invisible if neither adb sideloading // Verify that warning indicator is invisible if ADB sideloading is not
// is enabled nor the device is enrolled. // enabled.
EXPECT_FALSE(test_api.bottom_status_indicator()->GetVisible()); EXPECT_FALSE(test_api.bottom_status_indicator()->GetVisible());
} }
...@@ -819,31 +818,6 @@ TEST_F(LockContentsViewUnitTest, ShowStatusIndicatorIfAdbSideloadingEnabled) { ...@@ -819,31 +818,6 @@ TEST_F(LockContentsViewUnitTest, ShowStatusIndicatorIfAdbSideloadingEnabled) {
EXPECT_TRUE(test_api.bottom_status_indicator()->GetVisible()); EXPECT_TRUE(test_api.bottom_status_indicator()->GetVisible());
} }
// Show bottom status indicator if device is enrolled
TEST_F(LockContentsViewUnitTest, ShowStatusIndicatorIfEnrolledDevice) {
// If the device is enrolled, bottom_status_indicator should be visible.
Shell::Get()->system_tray_model()->SetEnterpriseDisplayDomain(
"BestCompanyEver", false);
auto* contents = new LockContentsView(
mojom::TrayActionState::kAvailable, LockScreen::ScreenType::kLock,
DataDispatcher(),
std::make_unique<FakeLoginDetachableBaseModel>(DataDispatcher()));
SetUserCount(1);
std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
LockContentsView::TestApi test_api(contents);
EXPECT_TRUE(test_api.bottom_status_indicator()->GetVisible());
// bottom_status_indicator should not be visible when displaying enterprise
// domain and extension UI is visible.
DataDispatcher()->NotifyOobeDialogState(OobeDialogState::EXTENSION_LOGIN);
EXPECT_FALSE(test_api.bottom_status_indicator()->GetVisible());
DataDispatcher()->NotifyOobeDialogState(OobeDialogState::HIDDEN);
EXPECT_TRUE(test_api.bottom_status_indicator()->GetVisible());
}
// Verifies the easy unlock tooltip is automatically displayed when requested. // Verifies the easy unlock tooltip is automatically displayed when requested.
TEST_F(LockContentsViewUnitTest, EasyUnlockForceTooltipCreatesTooltipWidget) { TEST_F(LockContentsViewUnitTest, EasyUnlockForceTooltipCreatesTooltipWidget) {
auto* lock = new LockContentsView( auto* lock = new LockContentsView(
......
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