[go: nahoru, domu]

cros: Hide add guest button in LoginShelf if mojo call requested it.

Bug: 864270
Change-Id: I8bdcbfa8f9d3a84776a08cb1e39d609a77ba08b0
Reviewed-on: https://chromium-review.googlesource.com/1141091
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576114}
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc
index 9b104e96..eb5d40d 100644
--- a/ash/login/login_screen_controller.cc
+++ b/ash/login/login_screen_controller.cc
@@ -10,6 +10,7 @@
 #include "ash/public/cpp/ash_pref_names.h"
 #include "ash/root_window_controller.h"
 #include "ash/session/session_controller.h"
+#include "ash/shelf/login_shelf_view.h"
 #include "ash/shelf/shelf.h"
 #include "ash/shelf/shelf_widget.h"
 #include "ash/shell.h"
@@ -320,6 +321,10 @@
   DCHECK(DataDispatcher());
 
   DataDispatcher()->NotifyUsers(users);
+  Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
+      ->shelf_widget()
+      ->login_shelf_view()
+      ->SetAllowLoginAsGuest(show_guest);
 }
 
 void LoginScreenController::SetPinEnabledForUser(const AccountId& account_id,
@@ -405,12 +410,14 @@
     std::vector<mojom::KioskAppInfoPtr> kiosk_apps) {
   Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
       ->shelf_widget()
-      ->SetLoginKioskApps(std::move(kiosk_apps));
+      ->login_shelf_view()
+      ->SetKioskApps(std::move(kiosk_apps));
 }
 
 void LoginScreenController::NotifyOobeDialogVisibility(bool visible) {
   Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
       ->shelf_widget()
+      ->login_shelf_view()
       ->SetLoginDialogVisible(visible);
 }