summaryrefslogtreecommitdiffstats
path: root/remoting/host/service_urls.h
blob: b2d8846f5b81883697e2d61ff7241889bd0bc9fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_HOST_SERVICE_URLS_H_
#define REMOTING_HOST_SERVICE_URLS_H_

#include <string>

#include "base/basictypes.h"
#include "base/memory/singleton.h"

namespace remoting {

// This class contains the URLs to the services used by the host (except for
// Gaia, which has its own GaiaUrls class. In debug builds, it allows these URLs
// to be overriden by command line switches, allowing the host process to be
// pointed at alternate/test servers.
class ServiceUrls {
 public:
  static ServiceUrls* GetInstance();

  // Remoting directory REST API URLs.
  const std::string& directory_base_url() const;
  const std::string& directory_hosts_url() const;

  // XMPP Server configuration.
  const std::string& xmpp_server_address() const;
  bool xmpp_server_use_tls() const;

  // Remoting directory bot JID (for registering hosts, logging, heartbeats).
  const std::string& directory_bot_jid() const;

  // Use a NULL certificate for URLFetcher SSL client certificate requests.
  bool ignore_urlfetcher_cert_requests() const;

 private:
  friend struct DefaultSingletonTraits<ServiceUrls>;

  ServiceUrls();
  virtual ~ServiceUrls();

  std::string directory_base_url_;
  std::string directory_hosts_url_;
  std::string xmpp_server_address_;
  bool xmpp_server_use_tls_;
  std::string directory_bot_jid_;
  bool ignore_urlfetcher_cert_requests_;

  DISALLOW_COPY_AND_ASSIGN(ServiceUrls);
};

}  // namespace remoting

#endif  // REMOTING_HOST_SERVICE_URLS_H_