OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <string> |
| 6 |
| 7 #include "chrome/browser/sync/notifier/communicator/login_settings.h" |
| 8 |
| 9 #include "chrome/browser/sync/notifier/communicator/connection_options.h" |
| 10 #include "chrome/browser/sync/notifier/communicator/xmpp_connection_generator.h" |
| 11 #include "talk/base/common.h" |
| 12 #include "talk/base/socketaddress.h" |
| 13 #include "talk/xmpp/xmppclientsettings.h" |
| 14 |
| 15 namespace notifier { |
| 16 |
| 17 LoginSettings::LoginSettings(const buzz::XmppClientSettings& user_settings, |
| 18 const ConnectionOptions& options, |
| 19 std::string lang, |
| 20 ServerInformation* server_list, |
| 21 int server_count, |
| 22 talk_base::FirewallManager* firewall, |
| 23 bool no_gaia_auth, |
| 24 bool proxy_only) |
| 25 : proxy_only_(proxy_only), |
| 26 no_gaia_auth_(no_gaia_auth), |
| 27 firewall_(firewall), |
| 28 lang_(lang), |
| 29 server_list_(new ServerInformation[server_count]), |
| 30 server_count_(server_count), |
| 31 user_settings_(new buzz::XmppClientSettings(user_settings)), |
| 32 connection_options_(new ConnectionOptions(options)) { |
| 33 // Note: firewall may be NULL |
| 34 ASSERT(server_list != 0); |
| 35 ASSERT(server_count > 0); |
| 36 for (int i = 0; i < server_count_; ++i) { |
| 37 server_list_[i] = server_list[i]; |
| 38 } |
| 39 } |
| 40 |
| 41 // defined so that the destructors are executed here (and |
| 42 // the corresponding classes don't need to be included in |
| 43 // the header file) |
| 44 LoginSettings::~LoginSettings() { |
| 45 } |
| 46 |
| 47 void LoginSettings::set_server_override( |
| 48 const talk_base::SocketAddress& server) { |
| 49 server_override_.reset(new ServerInformation()); |
| 50 server_override_->server = server; |
| 51 server_override_->special_port_magic = server_list_[0].special_port_magic; |
| 52 } |
| 53 |
| 54 void LoginSettings::clear_server_override() { |
| 55 server_override_.reset(); |
| 56 } |
| 57 } // namespace notifier |
OLD | NEW |