message_receiver_impl.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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_COMPONENTS_PHONEHUB_MESSAGE_RECEIVER_IMPL_H_
  5. #define ASH_COMPONENTS_PHONEHUB_MESSAGE_RECEIVER_IMPL_H_
  6. #include "ash/components/phonehub/message_receiver.h"
  7. #include "ash/services/secure_channel/public/cpp/client/connection_manager.h"
  8. namespace ash {
  9. namespace phonehub {
  10. // MessageReceiver implementation that observes all received messages from
  11. // the remote phone and notifies clients of the received messages.
  12. class MessageReceiverImpl : public MessageReceiver,
  13. public secure_channel::ConnectionManager::Observer {
  14. public:
  15. explicit MessageReceiverImpl(
  16. secure_channel::ConnectionManager* connection_manager);
  17. ~MessageReceiverImpl() override;
  18. private:
  19. // secure_channel::ConnectionManager::Observer:
  20. void OnMessageReceived(const std::string& payload) override;
  21. secure_channel::ConnectionManager* connection_manager_;
  22. };
  23. } // namespace phonehub
  24. } // namespace ash
  25. #endif // ASH_COMPONENTS_PHONEHUB_MESSAGE_RECEIVER_IMPL_H_