remote_status_update.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2014 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_COMPONENTS_PROXIMITY_AUTH_REMOTE_STATUS_UPDATE_H_
  5. #define ASH_COMPONENTS_PROXIMITY_AUTH_REMOTE_STATUS_UPDATE_H_
  6. #include <memory>
  7. #include "base/values.h"
  8. namespace proximity_auth {
  9. // Corresponds to the possible values for the 'user_presence' status update
  10. // field.
  11. enum UserPresence {
  12. USER_PRESENT,
  13. USER_ABSENT,
  14. USER_PRESENCE_UNKNOWN,
  15. USER_PRESENCE_SECONDARY,
  16. USER_PRESENCE_BACKGROUND,
  17. };
  18. // Corresponds to the possible values for the 'secure_screen_lock' status update
  19. // field.
  20. enum SecureScreenLockState {
  21. SECURE_SCREEN_LOCK_ENABLED,
  22. SECURE_SCREEN_LOCK_DISABLED,
  23. SECURE_SCREEN_LOCK_STATE_UNKNOWN,
  24. };
  25. // Corresponds to the possible values for the 'trust_agent' status update field.
  26. enum TrustAgentState {
  27. TRUST_AGENT_ENABLED,
  28. TRUST_AGENT_DISABLED,
  29. TRUST_AGENT_UNSUPPORTED,
  30. };
  31. // Represents a 'status_update' message received from the remote device.
  32. struct RemoteStatusUpdate {
  33. // Parses a dictionary value into a RemoteStatusUpdate. Returns a null pointer
  34. // if the serialized dictionary value is not valid.
  35. static std::unique_ptr<RemoteStatusUpdate> Deserialize(
  36. const base::Value::Dict& serialized_value);
  37. UserPresence user_presence;
  38. SecureScreenLockState secure_screen_lock_state;
  39. TrustAgentState trust_agent_state;
  40. };
  41. } // namespace proximity_auth
  42. #endif // ASH_COMPONENTS_PROXIMITY_AUTH_REMOTE_STATUS_UPDATE_H_