[go: nahoru, domu]

[Login Shelf] Fix the issue that Shimless app controls do not work

This CL fixes the issue that got exposed by enabling the login shelf
widget. After the login shelf widget is enabled, the Shimless app
controls are not clickable.

This CL hides the login shelf widget and the shelf widget when the
session state is RMA.

Bug: 1350667
Change-Id: I6905fc88772237548818cf981e5d2273d5cba195
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3811900
Reviewed-by: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032816}
diff --git a/ash/shelf/login_shelf_widget.cc b/ash/shelf/login_shelf_widget.cc
index 123ff27..f1f5c8c 100644
--- a/ash/shelf/login_shelf_widget.cc
+++ b/ash/shelf/login_shelf_widget.cc
@@ -164,12 +164,18 @@
 
 void LoginShelfWidget::OnSessionStateChanged(
     session_manager::SessionState state) {
-  bool is_active = (state == session_manager::SessionState::ACTIVE);
+  // The login shelf should be hidden if:
+  // 1. the user session is active; or
+  // 2. the RMA app is active. The login shelf should be hidden to avoid
+  // blocking the RMA app controls or intercepting UI events.
+  bool hide_for_session_state =
+      (state == session_manager::SessionState::ACTIVE ||
+       state == session_manager::SessionState::RMA);
 
   // The visibility of `login_shelf_view_` is accessed in different places.
   // Therefore, ensure the consistency between the widget's visibility and the
   // view's visibility.
-  if (!is_active && !shelf_->ShouldHideOnSecondaryDisplay(state)) {
+  if (!hide_for_session_state && !shelf_->ShouldHideOnSecondaryDisplay(state)) {
     if (!IsVisible()) {
       Show();
       login_shelf_view_->SetVisible(true);