Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: jingle/notifier/base/notifier_options_util.cc

Issue 8802019: Roll libjingle to 98:99. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « jingle/glue/fake_network_manager.cc ('k') | remoting/jingle_glue/xmpp_signal_strategy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "jingle/notifier/base/notifier_options_util.h" 5 #include "jingle/notifier/base/notifier_options_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "jingle/notifier/base/const_communicator.h" 8 #include "jingle/notifier/base/const_communicator.h"
9 #include "jingle/notifier/base/notifier_options.h" 9 #include "jingle/notifier/base/notifier_options.h"
10 #include "talk/xmpp/jid.h" 10 #include "talk/xmpp/jid.h"
11 11
12 namespace notifier { 12 namespace notifier {
13 13
14 buzz::XmppClientSettings MakeXmppClientSettings( 14 buzz::XmppClientSettings MakeXmppClientSettings(
15 const NotifierOptions& notifier_options, 15 const NotifierOptions& notifier_options,
16 const std::string& email, const std::string& token, 16 const std::string& email, const std::string& token,
17 const std::string& token_service) { 17 const std::string& token_service) {
18 buzz::Jid jid = buzz::Jid(email); 18 buzz::Jid jid = buzz::Jid(email);
19 DCHECK(!jid.node().empty()); 19 DCHECK(!jid.node().empty());
20 DCHECK(jid.IsValid()); 20 DCHECK(jid.IsValid());
21 21
22 buzz::XmppClientSettings xmpp_client_settings; 22 buzz::XmppClientSettings xmpp_client_settings;
23 xmpp_client_settings.set_user(jid.node()); 23 xmpp_client_settings.set_user(jid.node());
24 xmpp_client_settings.set_resource("chrome-sync"); 24 xmpp_client_settings.set_resource("chrome-sync");
25 xmpp_client_settings.set_host(jid.domain()); 25 xmpp_client_settings.set_host(jid.domain());
26 xmpp_client_settings.set_use_tls(true); 26 xmpp_client_settings.set_use_tls(buzz::TLS_ENABLED);
27 xmpp_client_settings.set_auth_cookie( 27 xmpp_client_settings.set_auth_cookie(
28 notifier_options.invalidate_xmpp_login ? 28 notifier_options.invalidate_xmpp_login ?
29 token + "bogus" : token); 29 token + "bogus" : token);
30 xmpp_client_settings.set_token_service(token_service); 30 xmpp_client_settings.set_token_service(token_service);
31 if (notifier_options.allow_insecure_connection) { 31 if (notifier_options.allow_insecure_connection) {
32 xmpp_client_settings.set_allow_plain(true); 32 xmpp_client_settings.set_allow_plain(true);
33 xmpp_client_settings.set_use_tls(false); 33 xmpp_client_settings.set_use_tls(buzz::TLS_DISABLED);
34 } 34 }
35 return xmpp_client_settings; 35 return xmpp_client_settings;
36 } 36 }
37 37
38 ServerList GetServerList( 38 ServerList GetServerList(
39 const NotifierOptions& notifier_options) { 39 const NotifierOptions& notifier_options) {
40 ServerList servers; 40 ServerList servers;
41 // Override the default servers with a test notification server if one was 41 // Override the default servers with a test notification server if one was
42 // provided. 42 // provided.
43 if (!notifier_options.xmpp_host_port.host().empty()) { 43 if (!notifier_options.xmpp_host_port.host().empty()) {
44 servers.push_back( 44 servers.push_back(
45 ServerInformation(notifier_options.xmpp_host_port, false)); 45 ServerInformation(notifier_options.xmpp_host_port, false));
46 } else { 46 } else {
47 // The default servers know how to serve over port 443 (that's the magic). 47 // The default servers know how to serve over port 443 (that's the magic).
48 servers.push_back( 48 servers.push_back(
49 ServerInformation( 49 ServerInformation(
50 net::HostPortPair("talk.google.com", 50 net::HostPortPair("talk.google.com",
51 notifier::kDefaultXmppPort), 51 notifier::kDefaultXmppPort),
52 true)); 52 true));
53 servers.push_back( 53 servers.push_back(
54 ServerInformation( 54 ServerInformation(
55 net::HostPortPair("talkx.l.google.com", 55 net::HostPortPair("talkx.l.google.com",
56 notifier::kDefaultXmppPort), 56 notifier::kDefaultXmppPort),
57 true)); 57 true));
58 } 58 }
59 return servers; 59 return servers;
60 } 60 }
61 61
62 } // namespace notifier 62 } // namespace notifier
OLDNEW
« no previous file with comments | « jingle/glue/fake_network_manager.cc ('k') | remoting/jingle_glue/xmpp_signal_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698