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.
5 #ifndef REMOTING_HOST_HOST_CONFIG_H_
6 #define REMOTING_HOST_HOST_CONFIG_H_
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
14 class DictionaryValue
;
20 // Following constants define names for configuration parameters.
22 // Status of the host, whether it is enabled or disabled.
23 extern const char kHostEnabledConfigPath
[];
24 // Base JID of the host owner (may not equal the email for non-gmail users).
25 extern const char kHostOwnerConfigPath
[];
26 // Email of the owner of this host.
27 extern const char kHostOwnerEmailConfigPath
[];
28 // Login used to authenticate in XMPP network (could be a service account).
29 extern const char kXmppLoginConfigPath
[];
30 // Auth token used to authenticate to XMPP network.
31 extern const char kXmppAuthTokenConfigPath
[];
32 // OAuth refresh token used to fetch an access token for the XMPP network.
33 extern const char kOAuthRefreshTokenConfigPath
[];
34 // Auth service used to authenticate to XMPP network.
35 extern const char kXmppAuthServiceConfigPath
[];
36 // Unique identifier of the host used to register the host in directory.
37 // Normally a random UUID.
38 extern const char kHostIdConfigPath
[];
39 // Readable host name.
40 extern const char kHostNameConfigPath
[];
41 // Hash of the host secret used for authentication.
42 extern const char kHostSecretHashConfigPath
[];
43 // Private keys used for host authentication.
44 extern const char kPrivateKeyConfigPath
[];
45 // Whether consent is given for usage stats reporting.
46 extern const char kUsageStatsConsentConfigPath
[];
47 // Whether to offer VP9 encoding to clients.
48 extern const char kEnableVp9ConfigPath
[];
49 // Number of Kibibytes of frame data to allow each client to record.
50 extern const char kFrameRecorderBufferKbConfigPath
[];
52 // Helpers for serializing/deserializing Host configuration dictonaries.
53 scoped_ptr
<base::DictionaryValue
> HostConfigFromJson(
54 const std::string
& serialized
);
55 std::string
HostConfigToJson(const base::DictionaryValue
& host_config
);
57 // Helpers for loading/saving host configurations from/to files.
58 scoped_ptr
<base::DictionaryValue
> HostConfigFromJsonFile(
59 const base::FilePath
& config_file
);
60 bool HostConfigToJsonFile(const base::DictionaryValue
& host_config
,
61 const base::FilePath
& config_file
);
63 } // namespace remoting
65 #endif // REMOTING_HOST_HOST_CONFIG_H_