host_experiment_sender.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2017 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 REMOTING_CLIENT_HOST_EXPERIMENT_SENDER_H_
  5. #define REMOTING_CLIENT_HOST_EXPERIMENT_SENDER_H_
  6. #include <memory>
  7. #include <string>
  8. #include "remoting/protocol/session_plugin.h"
  9. #include "third_party/libjingle_xmpp/xmllite/xmlelement.h"
  10. namespace remoting {
  11. // A SessionPlugin implementation to send host configuration to the host.
  12. // Currently only WebApp sets the experiment configuration.
  13. // This is a temporary solution until we have more permanent approach
  14. // implemented, which should take host attributes into account.
  15. class HostExperimentSender : public protocol::SessionPlugin {
  16. public:
  17. HostExperimentSender(const std::string& experiment_config);
  18. // protocol::SessionPlugin implementation.
  19. std::unique_ptr<jingle_xmpp::XmlElement> GetNextMessage() override;
  20. void OnIncomingMessage(const jingle_xmpp::XmlElement& attachments) override;
  21. private:
  22. const std::string experiment_config_;
  23. bool message_sent_ = false;
  24. };
  25. } // namespace remoting
  26. #endif // REMOTING_CLIENT_HOST_EXPERIMENT_SENDER_H_