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_
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.
19 // Direct connection to the network, other proxy preferences are ignored.
22 // Try to retrieve a PAC script from http://wpad/wpad.dat or fall back to
26 // Try to retrieve a PAC script from kProxyPacURL or fall back to direct
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
40 // State of proxy configuration.
42 // Configuration is from policy.
44 // Configuration is from extension.
46 // Configuration is not from policy or extension but still precedes others.
48 // Configuration is from system.
50 // Configuration is recommended i.e there's a fallback configuration.
52 // Configuration is known to be not set.
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_