| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/connection_to_host.h" | 5 #include "remoting/protocol/connection_to_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 const buzz::XmlElement* stanza) { | 120 const buzz::XmlElement* stanza) { |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ConnectionToHost::OnSessionManagerReady() { | 124 void ConnectionToHost::OnSessionManagerReady() { |
| 125 DCHECK(CalledOnValidThread()); | 125 DCHECK(CalledOnValidThread()); |
| 126 | 126 |
| 127 // After SessionManager is initialized we can try to connect to the host. | 127 // After SessionManager is initialized we can try to connect to the host. |
| 128 scoped_ptr<CandidateSessionConfig> candidate_config = | 128 scoped_ptr<CandidateSessionConfig> candidate_config = |
| 129 CandidateSessionConfig::CreateDefault(); | 129 CandidateSessionConfig::CreateDefault(); |
| 130 if (!audio_stub_) |
| 131 CandidateSessionConfig::DisableAudioChannel(candidate_config.get()); |
| 132 |
| 130 session_ = session_manager_->Connect( | 133 session_ = session_manager_->Connect( |
| 131 host_jid_, authenticator_.Pass(), candidate_config.Pass()); | 134 host_jid_, authenticator_.Pass(), candidate_config.Pass()); |
| 132 session_->SetEventHandler(this); | 135 session_->SetEventHandler(this); |
| 133 } | 136 } |
| 134 | 137 |
| 135 void ConnectionToHost::OnIncomingSession( | 138 void ConnectionToHost::OnIncomingSession( |
| 136 Session* session, | 139 Session* session, |
| 137 SessionManager::IncomingSessionResponse* response) { | 140 SessionManager::IncomingSessionResponse* response) { |
| 138 DCHECK(CalledOnValidThread()); | 141 DCHECK(CalledOnValidThread()); |
| 139 // Client always rejects incoming sessions. | 142 // Client always rejects incoming sessions. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 283 |
| 281 if (state != state_) { | 284 if (state != state_) { |
| 282 state_ = state; | 285 state_ = state; |
| 283 error_ = error; | 286 error_ = error; |
| 284 event_callback_->OnConnectionState(state_, error_); | 287 event_callback_->OnConnectionState(state_, error_); |
| 285 } | 288 } |
| 286 } | 289 } |
| 287 | 290 |
| 288 } // namespace protocol | 291 } // namespace protocol |
| 289 } // namespace remoting | 292 } // namespace remoting |
| OLD | NEW |