| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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 #ifndef REMOTING_HOST_SERVICE_URLS_H_ | |
| 6 #define REMOTING_HOST_SERVICE_URLS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/singleton.h" | |
| 12 | |
| 13 namespace remoting { | |
| 14 | |
| 15 // This class contains the URLs to the services used by the host (except for | |
| 16 // Gaia, which has its own GaiaUrls class. In debug builds, it allows these URLs | |
| 17 // to be overriden by command line switches, allowing the host process to be | |
| 18 // pointed at alternate/test servers. | |
| 19 class ServiceUrls { | |
| 20 public: | |
| 21 static ServiceUrls* GetInstance(); | |
| 22 | |
| 23 // Remoting directory REST API URLs. | |
| 24 const std::string& directory_base_url() const { return directory_base_url_; } | |
| 25 const std::string& directory_hosts_url() const { | |
| 26 return directory_hosts_url_; | |
| 27 } | |
| 28 const std::string& gcd_base_url() const { return gcd_base_url_; } | |
| 29 | |
| 30 // XMPP Server configuration. | |
| 31 const std::string& xmpp_server_address() const { | |
| 32 return xmpp_server_address_; | |
| 33 } | |
| 34 const std::string& xmpp_server_address_for_me2me_host() const { | |
| 35 return xmpp_server_address_for_me2me_host_; | |
| 36 } | |
| 37 bool xmpp_server_use_tls() const { return xmpp_server_use_tls_; } | |
| 38 | |
| 39 // Remoting directory bot JID (for registering hosts, logging, heartbeats). | |
| 40 const std::string& directory_bot_jid() const { return directory_bot_jid_; } | |
| 41 | |
| 42 // JID for communicating with GCD. | |
| 43 const std::string& gcd_jid() const { return gcd_jid_; } | |
| 44 | |
| 45 // ICE config URL. | |
| 46 const std::string& ice_config_url() const { return ice_config_url_; } | |
| 47 | |
| 48 private: | |
| 49 friend struct base::DefaultSingletonTraits<ServiceUrls>; | |
| 50 | |
| 51 ServiceUrls(); | |
| 52 virtual ~ServiceUrls(); | |
| 53 | |
| 54 std::string directory_base_url_; | |
| 55 std::string directory_hosts_url_; | |
| 56 std::string gcd_base_url_; | |
| 57 std::string xmpp_server_address_; | |
| 58 std::string xmpp_server_address_for_me2me_host_; | |
| 59 bool xmpp_server_use_tls_; | |
| 60 std::string directory_bot_jid_; | |
| 61 std::string gcd_jid_; | |
| 62 std::string ice_config_url_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(ServiceUrls); | |
| 65 }; | |
| 66 | |
| 67 } // namespace remoting | |
| 68 | |
| 69 #endif // REMOTING_HOST_SERVICE_URLS_H_ | |
| OLD | NEW |