| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/jingle_glue/xmpp_signal_strategy.h" | 5 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" | 8 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" |
| 9 #include "remoting/jingle_glue/jingle_thread.h" | 9 #include "remoting/jingle_glue/jingle_thread.h" |
| 10 #include "remoting/jingle_glue/xmpp_socket_adapter.h" | 10 #include "remoting/jingle_glue/xmpp_socket_adapter.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 void XmppSignalStrategy::Init(StatusObserver* observer) { | 34 void XmppSignalStrategy::Init(StatusObserver* observer) { |
| 35 observer_ = observer; | 35 observer_ = observer; |
| 36 | 36 |
| 37 buzz::Jid login_jid(username_); | 37 buzz::Jid login_jid(username_); |
| 38 | 38 |
| 39 buzz::XmppClientSettings settings; | 39 buzz::XmppClientSettings settings; |
| 40 settings.set_user(login_jid.node()); | 40 settings.set_user(login_jid.node()); |
| 41 settings.set_host(login_jid.domain()); | 41 settings.set_host(login_jid.domain()); |
| 42 settings.set_resource("chromoting"); | 42 settings.set_resource("chromoting"); |
| 43 settings.set_use_tls(true); | 43 settings.set_use_tls(buzz::TLS_ENABLED); |
| 44 settings.set_token_service(auth_token_service_); | 44 settings.set_token_service(auth_token_service_); |
| 45 settings.set_auth_cookie(auth_token_); | 45 settings.set_auth_cookie(auth_token_); |
| 46 settings.set_server(talk_base::SocketAddress("talk.google.com", 5222)); | 46 settings.set_server(talk_base::SocketAddress("talk.google.com", 5222)); |
| 47 | 47 |
| 48 buzz::AsyncSocket* socket = new XmppSocketAdapter(settings, false); | 48 buzz::AsyncSocket* socket = new XmppSocketAdapter(settings, false); |
| 49 | 49 |
| 50 xmpp_client_ = new buzz::XmppClient(thread_->task_pump()); | 50 xmpp_client_ = new buzz::XmppClient(thread_->task_pump()); |
| 51 xmpp_client_->Connect(settings, "", socket, CreatePreXmppAuth(settings)); | 51 xmpp_client_->Connect(settings, "", socket, CreatePreXmppAuth(settings)); |
| 52 xmpp_client_->SignalStateChange.connect( | 52 xmpp_client_->SignalStateChange.connect( |
| 53 this, &XmppSignalStrategy::OnConnectionStateChanged); | 53 this, &XmppSignalStrategy::OnConnectionStateChanged); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 return new notifier::GaiaTokenPreXmppAuth( | 147 return new notifier::GaiaTokenPreXmppAuth( |
| 148 jid.Str(), | 148 jid.Str(), |
| 149 settings.auth_cookie(), | 149 settings.auth_cookie(), |
| 150 settings.token_service(), | 150 settings.token_service(), |
| 151 mechanism); | 151 mechanism); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace remoting | 154 } // namespace remoting |
| OLD | NEW |