messenger_observer.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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_MESSENGER_OBSERVER_H_
  5. #define ASH_COMPONENTS_PROXIMITY_AUTH_MESSENGER_OBSERVER_H_
  6. #include <memory>
  7. #include <string>
  8. namespace proximity_auth {
  9. struct RemoteStatusUpdate;
  10. // An interface for observing events that happen on a Messenger.
  11. class MessengerObserver {
  12. public:
  13. // Called when sending an "Easy Unlock used" local event message completes.
  14. // |success| is true iff the event was sent successfully.
  15. virtual void OnUnlockEventSent(bool success) {}
  16. // Called when a RemoteStatusUpdate is received.
  17. virtual void OnRemoteStatusUpdate(const RemoteStatusUpdate& status_update) {}
  18. // Called when a response to a 'decrypt_request' is received, with the
  19. // |decrypted_bytes| that were returned by the remote device. An empty string
  20. // indicates failure.
  21. virtual void OnDecryptResponse(const std::string& decrypted_bytes) {}
  22. // Called when a response to a 'unlock_request' is received.
  23. // |success| is true iff the request was made successfully.
  24. virtual void OnUnlockResponse(bool success) {}
  25. // Called when the underlying secure channel disconnects.
  26. virtual void OnDisconnected() {}
  27. };
  28. } // namespace proximity_auth
  29. #endif // ASH_COMPONENTS_PROXIMITY_AUTH_MESSENGER_OBSERVER_H_