host_experiment_sender.cc 952 B

12345678910111213141516171819202122232425262728
  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. #include "remoting/client/host_experiment_sender.h"
  5. #include "remoting/base/constants.h"
  6. namespace remoting {
  7. HostExperimentSender::HostExperimentSender(const std::string& experiment_config)
  8. : experiment_config_(experiment_config) {}
  9. std::unique_ptr<jingle_xmpp::XmlElement> HostExperimentSender::GetNextMessage() {
  10. if (message_sent_ || experiment_config_.empty()) {
  11. return nullptr;
  12. }
  13. message_sent_ = true;
  14. std::unique_ptr<jingle_xmpp::XmlElement> configuration(new jingle_xmpp::XmlElement(
  15. jingle_xmpp::QName(kChromotingXmlNamespace, "host-configuration")));
  16. configuration->SetBodyText(experiment_config_);
  17. return configuration;
  18. }
  19. void HostExperimentSender::OnIncomingMessage(
  20. const jingle_xmpp::XmlElement& attachments) {}
  21. } // namespace remoting