OLD | NEW |
1 // Copyright (c) 2012 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_API_PROXY_PROXY_API_HELPERS_H_ | 7 #ifndef CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ |
8 #define CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ | 8 #define CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // caller did not pass one. | 93 // caller did not pass one. |
94 // Returns true if successful and sets |error| otherwise. | 94 // Returns true if successful and sets |error| otherwise. |
95 bool GetProxyServer(const base::DictionaryValue* proxy_server, | 95 bool GetProxyServer(const base::DictionaryValue* proxy_server, |
96 net::ProxyServer::Scheme default_scheme, | 96 net::ProxyServer::Scheme default_scheme, |
97 net::ProxyServer* out, | 97 net::ProxyServer* out, |
98 std::string* error, | 98 std::string* error, |
99 bool* bad_message); | 99 bool* bad_message); |
100 | 100 |
101 // Joins a list of URLs (stored as StringValues) in |list| with |joiner| | 101 // Joins a list of URLs (stored as StringValues) in |list| with |joiner| |
102 // to |out|. Returns true if successful and sets |error| otherwise. | 102 // to |out|. Returns true if successful and sets |error| otherwise. |
103 bool JoinUrlList(base::ListValue* list, | 103 bool JoinUrlList(const base::ListValue* list, |
104 const std::string& joiner, | 104 const std::string& joiner, |
105 std::string* out, | 105 std::string* out, |
106 std::string* error, | 106 std::string* error, |
107 bool* bad_message); | 107 bool* bad_message); |
108 | 108 |
109 | 109 |
110 // Helper functions for browser->extension pref transformation: | 110 // Helper functions for browser->extension pref transformation: |
111 | 111 |
112 // Creates and returns a ProxyRules dictionary as defined in the extension API | 112 // Creates and returns a ProxyRules dictionary as defined in the extension API |
113 // with the values of a ProxyConfigDictionary configured for fixed proxy | 113 // with the values of a ProxyConfigDictionary configured for fixed proxy |
(...skipping 14 matching lines...) Expand all Loading... |
128 | 128 |
129 // Tokenizes the |in| at delimiters |delims| and returns a new ListValue with | 129 // Tokenizes the |in| at delimiters |delims| and returns a new ListValue with |
130 // StringValues created from the tokens. Ownership is passed to the caller. | 130 // StringValues created from the tokens. Ownership is passed to the caller. |
131 base::ListValue* TokenizeToStringList(const std::string& in, | 131 base::ListValue* TokenizeToStringList(const std::string& in, |
132 const std::string& delims); | 132 const std::string& delims); |
133 | 133 |
134 } // namespace proxy_api_helpers | 134 } // namespace proxy_api_helpers |
135 } // namespace extensions | 135 } // namespace extensions |
136 | 136 |
137 #endif // CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ | 137 #endif // CHROME_BROWSER_EXTENSIONS_API_PROXY_PROXY_API_HELPERS_H_ |
OLD | NEW |