Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: chrome/browser/extensions/api/proxy/proxy_api_helpers.h

Issue 12315019: Change ProxyRules to handle ProxyLists rather than just single ProxyServer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
114 // servers. Returns NULL in case of failures. Ownership is passed to the caller. 114 // servers. Returns NULL in case of failures. Ownership is passed to the caller.
115 base::DictionaryValue* CreateProxyRulesDict( 115 base::DictionaryValue* CreateProxyRulesDict(
116 const ProxyConfigDictionary& proxy_config); 116 const ProxyConfigDictionary& proxy_config);
117 117
118 // Creates and returns a ProxyServer dictionary as defined in the extension API 118 // Creates and returns a ProxyServer dictionary as defined in the extension API
119 // with values from a net::ProxyServer object. Never returns NULL. Ownership is 119 // with values from a net::ProxyList containing exactly one net::ProxyServer
120 // passed to the caller. 120 // object. Never returns NULL. Ownership is passed to the caller.
121 base::DictionaryValue* CreateProxyServerDict(const net::ProxyServer& proxy); 121 base::DictionaryValue* CreateProxyServerDict(const net::ProxyList& proxies);
122 122
123 // Creates and returns a PacScript dictionary as defined in the extension API 123 // Creates and returns a PacScript dictionary as defined in the extension API
124 // with the values of a ProxyconfigDictionary configured for pac scripts. 124 // with the values of a ProxyconfigDictionary configured for pac scripts.
125 // Returns NULL in case of failures. Ownership is passed to the caller. 125 // Returns NULL in case of failures. Ownership is passed to the caller.
126 base::DictionaryValue* CreatePacScriptDict( 126 base::DictionaryValue* CreatePacScriptDict(
127 const ProxyConfigDictionary& proxy_config); 127 const ProxyConfigDictionary& proxy_config);
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698