login_screen.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_CPP_LOGIN_SCREEN_H_
  5. #define ASH_PUBLIC_CPP_LOGIN_SCREEN_H_
  6. #include <string>
  7. #include "ash/public/cpp/ash_public_export.h"
  8. #include "ash/public/cpp/login_types.h"
  9. #include "base/callback_forward.h"
  10. #include "ui/views/widget/widget.h"
  11. namespace ash {
  12. class LoginScreenClient;
  13. class LoginScreenModel;
  14. class ScopedGuestButtonBlocker;
  15. // Allows clients (e.g. the browser process) to send messages to the ash
  16. // login/lock/user-add screens.
  17. // TODO(estade): move more of mojom::LoginScreen here.
  18. class ASH_PUBLIC_EXPORT LoginScreen {
  19. public:
  20. // Returns the singleton instance.
  21. static LoginScreen* Get();
  22. virtual void SetClient(LoginScreenClient* client) = 0;
  23. virtual LoginScreenModel* GetModel() = 0;
  24. // Displays the lock screen.
  25. virtual void ShowLockScreen() = 0;
  26. // Displays the login screen.
  27. virtual void ShowLoginScreen() = 0;
  28. // Display a toast describing the latest kiosk app launch error.
  29. virtual void ShowKioskAppError(const std::string& message) = 0;
  30. // Transitions focus to the shelf area. If |reverse|, focuses the status area.
  31. virtual void FocusLoginShelf(bool reverse) = 0;
  32. // Returns if the login/lock screen is ready for a password. Currently only
  33. // used for testing.
  34. virtual bool IsReadyForPassword() = 0;
  35. // Sets whether users can be added from the login screen.
  36. virtual void EnableAddUserButton(bool enable) = 0;
  37. // Sets whether shutdown button is enabled in the login screen.
  38. virtual void EnableShutdownButton(bool enable) = 0;
  39. // Sets whether shelf buttons are enabled.
  40. virtual void EnableShelfButtons(bool enable) = 0;
  41. // Used to show or hide apps the guest and buttons on the login shelf during
  42. // OOBE.
  43. virtual void SetIsFirstSigninStep(bool is_first) = 0;
  44. // Shows or hides the parent access button on the login shelf.
  45. virtual void ShowParentAccessButton(bool show) = 0;
  46. // Sets if the guest button on the login shelf can be shown. Even if set to
  47. // true the button may still not be visible.
  48. virtual void SetAllowLoginAsGuest(bool allow_guest) = 0;
  49. // Returns scoped object to temporarily disable Browse as Guest button.
  50. virtual std::unique_ptr<ScopedGuestButtonBlocker>
  51. GetScopedGuestButtonBlocker() = 0;
  52. // Called to request the user to enter the PIN of the security token (e.g.,
  53. // the smart card).
  54. virtual void RequestSecurityTokenPin(SecurityTokenPinRequest request) = 0;
  55. // Called to close the UI previously opened with RequestSecurityTokenPin().
  56. virtual void ClearSecurityTokenPinRequest() = 0;
  57. // Get login screen widget. Currently used to set proper accessibility
  58. // navigation.
  59. virtual views::Widget* GetLoginWindowWidget() = 0;
  60. protected:
  61. LoginScreen();
  62. virtual ~LoginScreen();
  63. };
  64. } // namespace ash
  65. #endif // ASH_PUBLIC_CPP_LOGIN_SCREEN_H_