API for binary_dependencies, and import changes to call the new API.
[chromium-blink-merge.git] / components / proxy_config / proxy_prefs.h
blob8af504f5d14980a34108a3194b8428b716510c48
1 // Copyright (c) 2011 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 COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_
6 #define COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_
8 #include <string>
10 #include "components/proxy_config/proxy_config_export.h"
12 namespace ProxyPrefs {
14 // Possible types of specifying proxy settings. Do not change the order of
15 // the constants, because numeric values are exposed to users.
16 // If you add an enum constant, you should also add a string to
17 // kProxyModeNames in the .cc file.
18 enum ProxyMode {
19 // Direct connection to the network, other proxy preferences are ignored.
20 MODE_DIRECT = 0,
22 // Try to retrieve a PAC script from http://wpad/wpad.dat or fall back to
23 // direct connection.
24 MODE_AUTO_DETECT = 1,
26 // Try to retrieve a PAC script from kProxyPacURL or fall back to direct
27 // connection.
28 MODE_PAC_SCRIPT = 2,
30 // Use the settings specified in kProxyServer and kProxyBypassList.
31 MODE_FIXED_SERVERS = 3,
33 // The system's proxy settings are used, other proxy preferences are
34 // ignored.
35 MODE_SYSTEM = 4,
37 kModeCount
40 // State of proxy configuration.
41 enum ConfigState {
42 // Configuration is from policy.
43 CONFIG_POLICY,
44 // Configuration is from extension.
45 CONFIG_EXTENSION,
46 // Configuration is not from policy or extension but still precedes others.
47 CONFIG_OTHER_PRECEDE,
48 // Configuration is from system.
49 CONFIG_SYSTEM,
50 // Configuration is recommended i.e there's a fallback configuration.
51 CONFIG_FALLBACK,
52 // Configuration is known to be not set.
53 CONFIG_UNSET,
56 // Constants for string values used to specify the proxy mode through externally
57 // visible APIs, e.g. through policy or the proxy extension API.
58 PROXY_CONFIG_EXPORT extern const char kDirectProxyModeName[];
59 PROXY_CONFIG_EXPORT extern const char kAutoDetectProxyModeName[];
60 PROXY_CONFIG_EXPORT extern const char kPacScriptProxyModeName[];
61 PROXY_CONFIG_EXPORT extern const char kFixedServersProxyModeName[];
62 PROXY_CONFIG_EXPORT extern const char kSystemProxyModeName[];
64 PROXY_CONFIG_EXPORT bool IntToProxyMode(int in_value, ProxyMode* out_value);
65 PROXY_CONFIG_EXPORT bool StringToProxyMode(const std::string& in_value,
66 ProxyMode* out_value);
67 // Ownership of the return value is NOT passed to the caller.
68 PROXY_CONFIG_EXPORT const char* ProxyModeToString(ProxyMode mode);
69 PROXY_CONFIG_EXPORT std::string ConfigStateToDebugString(ConfigState state);
71 } // namespace ProxyPrefs
73 #endif // COMPONENTS_PROXY_CONFIG_PROXY_PREFS_H_