host_config.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright (c) 2012 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. #ifndef REMOTING_HOST_HOST_CONFIG_H_
  5. #define REMOTING_HOST_HOST_CONFIG_H_
  6. #include <memory>
  7. #include <string>
  8. #include "third_party/abseil-cpp/absl/types/optional.h"
  9. namespace base {
  10. class Value;
  11. class FilePath;
  12. } // namespace base
  13. namespace remoting {
  14. // Following constants define names for configuration parameters.
  15. // Status of the host, whether it is enabled or disabled.
  16. extern const char kHostEnabledConfigPath[];
  17. // Base JID of the host owner.
  18. // TODO(yuweih): This is now always equal to the host owner email. Consider
  19. // unifying these two fields.
  20. extern const char kHostOwnerConfigPath[];
  21. // Email of the owner of this host.
  22. extern const char kHostOwnerEmailConfigPath[];
  23. // Login used to authenticate signaling.
  24. extern const char kXmppLoginConfigPath[];
  25. // OAuth refresh token used to fetch an access token for calling network APIs.
  26. extern const char kOAuthRefreshTokenConfigPath[];
  27. // Unique identifier of the host used to register the host in directory.
  28. // Normally a random UUID.
  29. extern const char kHostIdConfigPath[];
  30. // Readable host name.
  31. extern const char kHostNameConfigPath[];
  32. // Hash of the host secret used for authentication.
  33. extern const char kHostSecretHashConfigPath[];
  34. // Private keys used for host authentication.
  35. extern const char kPrivateKeyConfigPath[];
  36. // Whether consent is given for usage stats reporting.
  37. extern const char kUsageStatsConsentConfigPath[];
  38. // Whether to offer VP9 encoding to clients.
  39. extern const char kEnableVp9ConfigPath[];
  40. // Whether to offer H264 encoding to clients.
  41. extern const char kEnableH264ConfigPath[];
  42. // Number of Kibibytes of frame data to allow each client to record.
  43. extern const char kFrameRecorderBufferKbConfigPath[];
  44. // Helpers for serializing/deserializing Host configuration dictionaries.
  45. absl::optional<base::Value> HostConfigFromJson(const std::string& serialized);
  46. std::string HostConfigToJson(const base::Value& host_config);
  47. // Helpers for loading/saving host configurations from/to files.
  48. absl::optional<base::Value> HostConfigFromJsonFile(
  49. const base::FilePath& config_file);
  50. bool HostConfigToJsonFile(const base::Value& host_config,
  51. const base::FilePath& config_file);
  52. } // namespace remoting
  53. #endif // REMOTING_HOST_HOST_CONFIG_H_