OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 // Definition of helper functions for the Chrome Extensions Proxy Settings API. | 5 // Definition of helper functions for the Chrome Extensions Proxy Settings API. |
6 | 6 |
7 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_HELPERS_H_ | 7 #ifndef CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ |
8 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_HELPERS_H_ | 8 #define CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "chrome/browser/prefs/proxy_prefs.h" | 13 #include "chrome/browser/prefs/proxy_prefs.h" |
14 #include "net/proxy/proxy_config.h" | 14 #include "net/proxy/proxy_config.h" |
15 | 15 |
16 class ProxyConfigDictionary; | 16 class ProxyConfigDictionary; |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class DictionaryValue; | 19 class DictionaryValue; |
20 class ListValue; | 20 class ListValue; |
21 } | 21 } |
22 | 22 |
23 namespace extension_proxy_api_helpers { | 23 namespace extensions { |
| 24 namespace proxy_api_helpers { |
24 | 25 |
25 // Conversion between PAC scripts and data-encoding URLs containing these | 26 // Conversion between PAC scripts and data-encoding URLs containing these |
26 // PAC scripts. Data-encoding URLs consist of a data:// prefix, a mime-type and | 27 // PAC scripts. Data-encoding URLs consist of a data:// prefix, a mime-type and |
27 // base64 encoded text. The functions return true in case of success. | 28 // base64 encoded text. The functions return true in case of success. |
28 // CreatePACScriptFromDataURL should only be called on data-encoding urls | 29 // CreatePACScriptFromDataURL should only be called on data-encoding urls |
29 // created with CreateDataURLFromPACScript. | 30 // created with CreateDataURLFromPACScript. |
30 bool CreateDataURLFromPACScript(const std::string& pac_script, | 31 bool CreateDataURLFromPACScript(const std::string& pac_script, |
31 std::string* pac_script_url_base64_encoded); | 32 std::string* pac_script_url_base64_encoded); |
32 bool CreatePACScriptFromDataURL( | 33 bool CreatePACScriptFromDataURL( |
33 const std::string& pac_script_url_base64_encoded, | 34 const std::string& pac_script_url_base64_encoded, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // with the values of a ProxyconfigDictionary configured for pac scripts. | 125 // with the values of a ProxyconfigDictionary configured for pac scripts. |
125 // Returns NULL in case of failures. Ownership is passed to the caller. | 126 // Returns NULL in case of failures. Ownership is passed to the caller. |
126 base::DictionaryValue* CreatePacScriptDict( | 127 base::DictionaryValue* CreatePacScriptDict( |
127 const ProxyConfigDictionary& proxy_config); | 128 const ProxyConfigDictionary& proxy_config); |
128 | 129 |
129 // Tokenizes the |in| at delimiters |delims| and returns a new ListValue with | 130 // Tokenizes the |in| at delimiters |delims| and returns a new ListValue with |
130 // StringValues created from the tokens. Ownership is passed to the caller. | 131 // StringValues created from the tokens. Ownership is passed to the caller. |
131 base::ListValue* TokenizeToStringList(const std::string& in, | 132 base::ListValue* TokenizeToStringList(const std::string& in, |
132 const std::string& delims); | 133 const std::string& delims); |
133 | 134 |
134 } // namespace extension_proxy_api_helpers | 135 } // namespace proxy_api_helpers |
| 136 } // namespace extensions |
135 | 137 |
136 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_HELPERS_H_ | 138 #endif // CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ |
OLD | NEW |