| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const buzz::XmlElement* stanza) { | 135 const buzz::XmlElement* stanza) { |
| 136 return false; | 136 return false; |
| 137 } | 137 } |
| 138 | 138 |
| 139 void ConnectionToHost::OnSessionManagerReady() { | 139 void ConnectionToHost::OnSessionManagerReady() { |
| 140 DCHECK(CalledOnValidThread()); | 140 DCHECK(CalledOnValidThread()); |
| 141 | 141 |
| 142 // After SessionManager is initialized we can try to connect to the host. | 142 // After SessionManager is initialized we can try to connect to the host. |
| 143 scoped_ptr<CandidateSessionConfig> candidate_config = | 143 scoped_ptr<CandidateSessionConfig> candidate_config = |
| 144 CandidateSessionConfig::CreateDefault(); | 144 CandidateSessionConfig::CreateDefault(); |
| 145 if (!audio_stub_) | 145 if (!audio_stub_) { |
| 146 CandidateSessionConfig::DisableAudioChannel(candidate_config.get()); | 146 candidate_config->DisableAudioChannel(); |
| 147 } |
| 147 | 148 |
| 148 session_ = session_manager_->Connect( | 149 session_ = session_manager_->Connect( |
| 149 host_jid_, authenticator_.Pass(), candidate_config.Pass()); | 150 host_jid_, authenticator_.Pass(), candidate_config.Pass()); |
| 150 session_->SetEventHandler(this); | 151 session_->SetEventHandler(this); |
| 151 } | 152 } |
| 152 | 153 |
| 153 void ConnectionToHost::OnIncomingSession( | 154 void ConnectionToHost::OnIncomingSession( |
| 154 Session* session, | 155 Session* session, |
| 155 SessionManager::IncomingSessionResponse* response) { | 156 SessionManager::IncomingSessionResponse* response) { |
| 156 DCHECK(CalledOnValidThread()); | 157 DCHECK(CalledOnValidThread()); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 292 |
| 292 if (state != state_) { | 293 if (state != state_) { |
| 293 state_ = state; | 294 state_ = state; |
| 294 error_ = error; | 295 error_ = error; |
| 295 event_callback_->OnConnectionState(state_, error_); | 296 event_callback_->OnConnectionState(state_, error_); |
| 296 } | 297 } |
| 297 } | 298 } |
| 298 | 299 |
| 299 } // namespace protocol | 300 } // namespace protocol |
| 300 } // namespace remoting | 301 } // namespace remoting |
| OLD | NEW |