| 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 20 matching lines...) Expand all Loading... |
| 31 PairingAuthenticatorBase::~PairingAuthenticatorBase() { | 31 PairingAuthenticatorBase::~PairingAuthenticatorBase() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 Authenticator::State PairingAuthenticatorBase::state() const { | 34 Authenticator::State PairingAuthenticatorBase::state() const { |
| 35 if (waiting_for_authenticator_) { | 35 if (waiting_for_authenticator_) { |
| 36 return PROCESSING_MESSAGE; | 36 return PROCESSING_MESSAGE; |
| 37 } | 37 } |
| 38 return v2_authenticator_->state(); | 38 return v2_authenticator_->state(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool PairingAuthenticatorBase::started() const { |
| 42 if (!v2_authenticator_) { |
| 43 return false; |
| 44 } |
| 45 return v2_authenticator_->started(); |
| 46 } |
| 47 |
| 41 Authenticator::RejectionReason | 48 Authenticator::RejectionReason |
| 42 PairingAuthenticatorBase::rejection_reason() const { | 49 PairingAuthenticatorBase::rejection_reason() const { |
| 43 if (!v2_authenticator_) { | 50 if (!v2_authenticator_) { |
| 44 return PROTOCOL_ERROR; | 51 return PROTOCOL_ERROR; |
| 45 } | 52 } |
| 46 return v2_authenticator_->rejection_reason(); | 53 return v2_authenticator_->rejection_reason(); |
| 47 } | 54 } |
| 48 | 55 |
| 49 void PairingAuthenticatorBase::ProcessMessage( | 56 void PairingAuthenticatorBase::ProcessMessage( |
| 50 const buzz::XmlElement* message, | 57 const buzz::XmlElement* message, |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 v2_authenticator_ = authenticator.Pass(); | 152 v2_authenticator_ = authenticator.Pass(); |
| 146 if (message) { | 153 if (message) { |
| 147 ProcessMessage(message, resume_callback); | 154 ProcessMessage(message, resume_callback); |
| 148 } else { | 155 } else { |
| 149 resume_callback.Run(); | 156 resume_callback.Run(); |
| 150 } | 157 } |
| 151 } | 158 } |
| 152 | 159 |
| 153 } // namespace protocol | 160 } // namespace protocol |
| 154 } // namespace remoting | 161 } // namespace remoting |
| OLD | NEW |