[go: nahoru, domu]

Oobe: disable shelf buttons when modal dialog is opened

We need to disable the shelf buttons when oobe-help-dialog (or cr-dialog) is opened during oobe since it is not a system modal and shelf buttons are still clickable.

I also updated oobe-help-dialog to use cr-dialog instead of dialog element since the shaded overlay looks better with the buttons that are in disabled state.

Bug: 1119338
Change-Id: I61e187733c0b94603b3eb59659c83c23a6d65d65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542905
Commit-Queue: Yunke Zhou <yunkez@google.com>
Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832244}
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc
index 95bbb145..ec1d56b 100644
--- a/ash/login/login_screen_controller.cc
+++ b/ash/login/login_screen_controller.cc
@@ -326,6 +326,13 @@
       ->SetShutdownButtonEnabled(enable);
 }
 
+void LoginScreenController::EnableShelfButtons(bool enable) {
+  Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
+      ->shelf_widget()
+      ->login_shelf_view()
+      ->SetButtonEnabled(enable);
+}
+
 void LoginScreenController::SetIsFirstSigninStep(bool is_first) {
   Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
       ->shelf_widget()