OLD | NEW |
1 // Copyright (c) 2011 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_CHROMEOS_PROXY_CROS_SETTINGS_PARSER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PARSER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PARSER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PARSER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class Value; | 13 class Value; |
14 } | 14 } |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 class UIProxyConfigService; | 18 class UIProxyConfigService; |
19 | 19 |
| 20 // This namespace defines helper functions and pref names for setting/getting a |
| 21 // Proxy configuration. These prefs are not directly read from or written to the |
| 22 // pref store, but instead are passed to/from UIProxyConfigService. |
| 23 |
| 24 namespace proxy_cros_settings_parser { |
| 25 |
20 extern const char kProxyPacUrl[]; | 26 extern const char kProxyPacUrl[]; |
21 extern const char kProxySingleHttp[]; | 27 extern const char kProxySingleHttp[]; |
22 extern const char kProxySingleHttpPort[]; | 28 extern const char kProxySingleHttpPort[]; |
23 extern const char kProxyHttpUrl[]; | 29 extern const char kProxyHttpUrl[]; |
24 extern const char kProxyHttpPort[]; | 30 extern const char kProxyHttpPort[]; |
25 extern const char kProxyHttpsUrl[]; | 31 extern const char kProxyHttpsUrl[]; |
26 extern const char kProxyHttpsPort[]; | 32 extern const char kProxyHttpsPort[]; |
27 extern const char kProxyType[]; | 33 extern const char kProxyType[]; |
28 extern const char kProxySingle[]; | 34 extern const char kProxySingle[]; |
29 extern const char kProxyFtpUrl[]; | 35 extern const char kProxyFtpUrl[]; |
30 extern const char kProxyFtpPort[]; | 36 extern const char kProxyFtpPort[]; |
31 extern const char kProxySocks[]; | 37 extern const char kProxySocks[]; |
32 extern const char kProxySocksPort[]; | 38 extern const char kProxySocksPort[]; |
33 extern const char kProxyIgnoreList[]; | 39 extern const char kProxyIgnoreList[]; |
34 extern const char kProxyUsePacUrl[]; | 40 extern const char kProxyUsePacUrl[]; |
35 | 41 |
36 extern const char* const kProxySettings[]; | 42 extern const char* const kProxySettings[]; |
37 extern const size_t kProxySettingsCount; | 43 extern const size_t kProxySettingsCount; |
38 | 44 |
39 // This namespace defines helper functions for setting/getting Proxy settings. | |
40 namespace proxy_cros_settings_parser { | |
41 | |
42 // Returns true if the supplied |path| is a proxy preference name. | 45 // Returns true if the supplied |path| is a proxy preference name. |
43 bool IsProxyPref(const std::string& path); | 46 bool IsProxyPref(const std::string& path); |
44 | 47 |
45 // Sets a value in the current proxy configuration on the specified profile. | 48 // Sets a value in the current proxy configuration on the specified profile. |
46 void SetProxyPrefValue(const std::string& path, | 49 void SetProxyPrefValue(const std::string& path, |
47 const base::Value* in_value, | 50 const base::Value* in_value, |
48 UIProxyConfigService* config_service); | 51 UIProxyConfigService* config_service); |
49 | 52 |
50 // Gets a value from the current proxy configuration on the specified profile. | 53 // Gets a value from the current proxy configuration on the specified profile. |
51 bool GetProxyPrefValue(const UIProxyConfigService& config_service, | 54 bool GetProxyPrefValue(const UIProxyConfigService& config_service, |
52 const std::string& path, | 55 const std::string& path, |
53 base::Value** out_value); | 56 base::Value** out_value); |
54 | 57 |
55 } // namespace proxy_cros_settings_parser | 58 } // namespace proxy_cros_settings_parser |
56 | 59 |
57 } // namespace chromeos | 60 } // namespace chromeos |
58 | 61 |
59 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PARSER_H_ | 62 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PARSER_H_ |
OLD | NEW |