MD Downloads: prevent search text from overlapping with the cancel search (X)
[chromium-blink-merge.git] / remoting / protocol / content_description.h
blob319d87593dcc4eefcbd200e583d50f547ed3bd03
1 // Copyright (c) 2012 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.
5 #ifndef REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_
6 #define REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "remoting/protocol/session_config.h"
14 namespace buzz {
15 class XmlElement;
16 } // namespace buzz
18 namespace remoting {
19 namespace protocol {
21 // ContentDescription used for chromoting sessions. It contains the information
22 // from the content description stanza in the session initialization handshake.
24 // This class also provides a type abstraction so that the Chromotocol Session
25 // interface does not need to depend on libjingle.
26 class ContentDescription {
27 public:
28 static const char kChromotingContentName[];
30 ContentDescription(scoped_ptr<CandidateSessionConfig> config,
31 scoped_ptr<buzz::XmlElement> authenticator_message,
32 const std::string& quic_config_message);
33 ~ContentDescription();
35 const CandidateSessionConfig* config() const {
36 return candidate_config_.get();
39 const buzz::XmlElement* authenticator_message() const {
40 return authenticator_message_.get();
43 const std::string& quic_config_message() const {
44 return quic_config_message_;
47 buzz::XmlElement* ToXml() const;
49 static scoped_ptr<ContentDescription> ParseXml(
50 const buzz::XmlElement* element);
52 private:
53 scoped_ptr<const CandidateSessionConfig> candidate_config_;
54 scoped_ptr<const buzz::XmlElement> authenticator_message_;
55 std::string quic_config_message_;
57 static bool ParseChannelConfigs(const buzz::XmlElement* const element,
58 const char tag_name[],
59 bool codec_required,
60 bool optional,
61 std::list<ChannelConfig>* const configs);
64 } // namespace protocol
65 } // namespace remoting
67 #endif // REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_