| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <cstddef> | 6 #include <cstddef> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "jingle/notifier/communicator/single_login_attempt.h" | 10 #include "jingle/notifier/communicator/single_login_attempt.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 const ConnectionSettings& connection_settings) { | 104 const ConnectionSettings& connection_settings) { |
| 105 buzz::XmppClientSettings client_settings = | 105 buzz::XmppClientSettings client_settings = |
| 106 login_settings_->user_settings(); | 106 login_settings_->user_settings(); |
| 107 // Fill in the rest of the client settings. | 107 // Fill in the rest of the client settings. |
| 108 connection_settings.FillXmppClientSettings(&client_settings); | 108 connection_settings.FillXmppClientSettings(&client_settings); |
| 109 | 109 |
| 110 buzz::Jid jid(client_settings.user(), client_settings.host(), | 110 buzz::Jid jid(client_settings.user(), client_settings.host(), |
| 111 buzz::STR_EMPTY); | 111 buzz::STR_EMPTY); |
| 112 buzz::PreXmppAuth* pre_xmpp_auth = | 112 buzz::PreXmppAuth* pre_xmpp_auth = |
| 113 new GaiaTokenPreXmppAuth( | 113 new GaiaTokenPreXmppAuth( |
| 114 jid.Str(), client_settings.auth_cookie(), | 114 jid.Str(), client_settings.auth_token(), |
| 115 client_settings.token_service(), | 115 client_settings.token_service(), |
| 116 login_settings_->auth_mechanism()); | 116 login_settings_->auth_mechanism()); |
| 117 xmpp_connection_.reset( | 117 xmpp_connection_.reset( |
| 118 new XmppConnection(client_settings, | 118 new XmppConnection(client_settings, |
| 119 login_settings_->request_context_getter(), | 119 login_settings_->request_context_getter(), |
| 120 this, pre_xmpp_auth)); | 120 this, pre_xmpp_auth)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void SingleLoginAttempt::OnExhaustedSettings( | 123 void SingleLoginAttempt::OnExhaustedSettings( |
| 124 bool successfully_resolved_dns, | 124 bool successfully_resolved_dns, |
| 125 int first_dns_error) { | 125 int first_dns_error) { |
| 126 if (!successfully_resolved_dns) | 126 if (!successfully_resolved_dns) |
| 127 VLOG(1) << "Could not resolve DNS: " << first_dns_error; | 127 VLOG(1) << "Could not resolve DNS: " << first_dns_error; |
| 128 VLOG(1) << "Could not connect to any XMPP server"; | 128 VLOG(1) << "Could not connect to any XMPP server"; |
| 129 delegate_->OnNeedReconnect(); | 129 delegate_->OnNeedReconnect(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace notifier | 132 } // namespace notifier |
| OLD | NEW |