in_session_auth_dialog_client.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2020 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_IN_SESSION_AUTH_DIALOG_CLIENT_H_
  5. #define ASH_PUBLIC_CPP_IN_SESSION_AUTH_DIALOG_CLIENT_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 "components/account_id/account_id.h"
  11. namespace aura {
  12. class Window;
  13. }
  14. namespace ash {
  15. // An interface that allows Ash to trigger authentication steps that ChromeOS
  16. // is responsible for.
  17. class ASH_PUBLIC_EXPORT InSessionAuthDialogClient {
  18. public:
  19. // Attempt to authenticate the current session user with a password or PIN.
  20. // |password|: The submitted password.
  21. // |authenticated_by_pin|: True if we are authenticating by PIN..
  22. // |callback|: the callback to run on auth complete.
  23. virtual void AuthenticateUserWithPasswordOrPin(
  24. const std::string& password,
  25. bool authenticated_by_pin,
  26. base::OnceCallback<void(bool)> callback) = 0;
  27. // Check whether fingerprint auth is available for |account_id|.
  28. virtual bool IsFingerprintAuthAvailable(const AccountId& account_id) = 0;
  29. // Switch biometrics daemon to auth mode.
  30. virtual void StartFingerprintAuthSession(
  31. const AccountId& account_id,
  32. base::OnceCallback<void(bool)> callback) = 0;
  33. // Switch biometrics daemon to normal mode. Used when closing the dialog.
  34. virtual void EndFingerprintAuthSession() = 0;
  35. // Check whether PIN auth is available for |account_id|.
  36. virtual void CheckPinAuthAvailability(
  37. const AccountId& account_id,
  38. base::OnceCallback<void(bool)> callback) = 0;
  39. virtual void AuthenticateUserWithFingerprint(
  40. base::OnceCallback<void(bool, FingerprintState)> callback) = 0;
  41. // Open a help article in a new window and return the window.
  42. virtual aura::Window* OpenInSessionAuthHelpPage() const = 0;
  43. protected:
  44. virtual ~InSessionAuthDialogClient() = default;
  45. };
  46. } // namespace ash
  47. #endif // ASH_PUBLIC_CPP_IN_SESSION_AUTH_DIALOG_CLIENT_H_