| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 buzz::XmppClientSettings client_settings = | 106 buzz::XmppClientSettings client_settings = |
| 107 login_settings_->user_settings(); | 107 login_settings_->user_settings(); |
| 108 // Fill in the rest of the client settings. | 108 // Fill in the rest of the client settings. |
| 109 connection_settings.FillXmppClientSettings(&client_settings); | 109 connection_settings.FillXmppClientSettings(&client_settings); |
| 110 | 110 |
| 111 buzz::Jid jid(client_settings.user(), client_settings.host(), | 111 buzz::Jid jid(client_settings.user(), client_settings.host(), |
| 112 buzz::STR_EMPTY); | 112 buzz::STR_EMPTY); |
| 113 buzz::PreXmppAuth* pre_xmpp_auth = | 113 buzz::PreXmppAuth* pre_xmpp_auth = |
| 114 new GaiaTokenPreXmppAuth( | 114 new GaiaTokenPreXmppAuth( |
| 115 jid.Str(), client_settings.auth_cookie(), | 115 jid.Str(), client_settings.auth_cookie(), |
| 116 client_settings.token_service()); | 116 client_settings.token_service(), |
| 117 login_settings_->auth_mechanism()); |
| 117 xmpp_connection_.reset( | 118 xmpp_connection_.reset( |
| 118 new XmppConnection(client_settings, login_settings_->cert_verifier(), | 119 new XmppConnection(client_settings, login_settings_->cert_verifier(), |
| 119 this, pre_xmpp_auth)); | 120 this, pre_xmpp_auth)); |
| 120 } | 121 } |
| 121 | 122 |
| 122 void SingleLoginAttempt::OnExhaustedSettings( | 123 void SingleLoginAttempt::OnExhaustedSettings( |
| 123 bool successfully_resolved_dns, | 124 bool successfully_resolved_dns, |
| 124 int first_dns_error) { | 125 int first_dns_error) { |
| 125 if (!successfully_resolved_dns) | 126 if (!successfully_resolved_dns) |
| 126 VLOG(1) << "Could not resolve DNS: " << first_dns_error; | 127 VLOG(1) << "Could not resolve DNS: " << first_dns_error; |
| 127 VLOG(1) << "Could not connect to any XMPP server"; | 128 VLOG(1) << "Could not connect to any XMPP server"; |
| 128 delegate_->OnNeedReconnect(); | 129 delegate_->OnNeedReconnect(); |
| 129 } | 130 } |
| 130 | 131 |
| 131 } // namespace notifier | 132 } // namespace notifier |
| OLD | NEW |