| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PREFS_PROXY_PREFS_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PROXY_PREFS_H_ |
| 6 #define CHROME_BROWSER_PREFS_PROXY_PREFS_H_ | 6 #define CHROME_BROWSER_PREFS_PROXY_PREFS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 namespace ProxyPrefs { | 11 namespace ProxyPrefs { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 29 // Use the settings specified in kProxyServer and kProxyBypassList. | 29 // Use the settings specified in kProxyServer and kProxyBypassList. |
| 30 MODE_FIXED_SERVERS = 3, | 30 MODE_FIXED_SERVERS = 3, |
| 31 | 31 |
| 32 // The system's proxy settings are used, other proxy preferences are | 32 // The system's proxy settings are used, other proxy preferences are |
| 33 // ignored. | 33 // ignored. |
| 34 MODE_SYSTEM = 4, | 34 MODE_SYSTEM = 4, |
| 35 | 35 |
| 36 kModeCount | 36 kModeCount |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // State of proxy configuration. |
| 40 enum ConfigState { |
| 41 // Configuration is from policy. |
| 42 CONFIG_POLICY, |
| 43 // Configuration is from extension. |
| 44 CONFIG_EXTENSION, |
| 45 // Configuration is not from policy or extension but still precedes others. |
| 46 CONFIG_OTHER_PRECEDE, |
| 47 // Configuration is from system. |
| 48 CONFIG_SYSTEM, |
| 49 // Configuration is recommended i.e there's a fallback configuration. |
| 50 CONFIG_FALLBACK, |
| 51 // Configuration is known to be not set. |
| 52 CONFIG_UNSET, |
| 53 }; |
| 54 |
| 39 // Constants for string values used to specify the proxy mode through externally | 55 // Constants for string values used to specify the proxy mode through externally |
| 40 // visible APIs, e.g. through policy or the proxy extension API. | 56 // visible APIs, e.g. through policy or the proxy extension API. |
| 41 extern const char kDirectProxyModeName[]; | 57 extern const char kDirectProxyModeName[]; |
| 42 extern const char kAutoDetectProxyModeName[]; | 58 extern const char kAutoDetectProxyModeName[]; |
| 43 extern const char kPacScriptProxyModeName[]; | 59 extern const char kPacScriptProxyModeName[]; |
| 44 extern const char kFixedServersProxyModeName[]; | 60 extern const char kFixedServersProxyModeName[]; |
| 45 extern const char kSystemProxyModeName[]; | 61 extern const char kSystemProxyModeName[]; |
| 46 | 62 |
| 47 bool IntToProxyMode(int in_value, ProxyMode* out_value); | 63 bool IntToProxyMode(int in_value, ProxyMode* out_value); |
| 48 bool StringToProxyMode(const std::string& in_value, | 64 bool StringToProxyMode(const std::string& in_value, |
| 49 ProxyMode* out_value); | 65 ProxyMode* out_value); |
| 50 // Ownership of the return value is NOT passed to the caller. | 66 // Ownership of the return value is NOT passed to the caller. |
| 51 const char* ProxyModeToString(ProxyMode mode); | 67 const char* ProxyModeToString(ProxyMode mode); |
| 52 | 68 |
| 69 bool DoesPrefPrecede(ConfigState config_state); |
| 70 |
| 53 } // namespace ProxyPrefs | 71 } // namespace ProxyPrefs |
| 54 | 72 |
| 55 #endif // CHROME_BROWSER_PREFS_PROXY_PREFS_H_ | 73 #endif // CHROME_BROWSER_PREFS_PROXY_PREFS_H_ |
| OLD | NEW |