OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/pairing_authenticator_base.h" | 5 #include "remoting/protocol/pairing_authenticator_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "remoting/base/constants.h" | 8 #include "remoting/base/constants.h" |
9 #include "remoting/protocol/channel_authenticator.h" | 9 #include "remoting/protocol/channel_authenticator.h" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 scoped_ptr<buzz::XmlElement> PairingAuthenticatorBase::GetNextMessage() { | 89 scoped_ptr<buzz::XmlElement> PairingAuthenticatorBase::GetNextMessage() { |
90 DCHECK_EQ(state(), MESSAGE_READY); | 90 DCHECK_EQ(state(), MESSAGE_READY); |
91 scoped_ptr<buzz::XmlElement> result = v2_authenticator_->GetNextMessage(); | 91 scoped_ptr<buzz::XmlElement> result = v2_authenticator_->GetNextMessage(); |
92 AddPairingElements(result.get()); | 92 AddPairingElements(result.get()); |
93 MaybeAddErrorMessage(result.get()); | 93 MaybeAddErrorMessage(result.get()); |
94 return result.Pass(); | 94 return result.Pass(); |
95 } | 95 } |
96 | 96 |
| 97 const std::string& PairingAuthenticatorBase::GetAuthKey() const { |
| 98 return v2_authenticator_->GetAuthKey(); |
| 99 } |
| 100 |
97 scoped_ptr<ChannelAuthenticator> | 101 scoped_ptr<ChannelAuthenticator> |
98 PairingAuthenticatorBase::CreateChannelAuthenticator() const { | 102 PairingAuthenticatorBase::CreateChannelAuthenticator() const { |
99 return v2_authenticator_->CreateChannelAuthenticator(); | 103 return v2_authenticator_->CreateChannelAuthenticator(); |
100 } | 104 } |
101 | 105 |
102 void PairingAuthenticatorBase::MaybeAddErrorMessage(buzz::XmlElement* message) { | 106 void PairingAuthenticatorBase::MaybeAddErrorMessage(buzz::XmlElement* message) { |
103 if (!error_message_.empty()) { | 107 if (!error_message_.empty()) { |
104 buzz::XmlElement* pairing_failed_tag = | 108 buzz::XmlElement* pairing_failed_tag = |
105 new buzz::XmlElement(kPairingFailedTag); | 109 new buzz::XmlElement(kPairingFailedTag); |
106 pairing_failed_tag->AddAttr(kPairingErrorAttribute, error_message_); | 110 pairing_failed_tag->AddAttr(kPairingErrorAttribute, error_message_); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 v2_authenticator_ = authenticator.Pass(); | 156 v2_authenticator_ = authenticator.Pass(); |
153 if (message) { | 157 if (message) { |
154 ProcessMessage(message, resume_callback); | 158 ProcessMessage(message, resume_callback); |
155 } else { | 159 } else { |
156 resume_callback.Run(); | 160 resume_callback.Run(); |
157 } | 161 } |
158 } | 162 } |
159 | 163 |
160 } // namespace protocol | 164 } // namespace protocol |
161 } // namespace remoting | 165 } // namespace remoting |
OLD | NEW |