Chromium Code Reviews| Index: chrome/browser/prefs/proxy_prefs.h |
| diff --git a/chrome/browser/prefs/proxy_prefs.h b/chrome/browser/prefs/proxy_prefs.h |
| index da911d4e857db21329aaf8286ee7bd590d984008..235e5b558b4b98396f62bc3566f09da952e82fd1 100644 |
| --- a/chrome/browser/prefs/proxy_prefs.h |
| +++ b/chrome/browser/prefs/proxy_prefs.h |
| @@ -8,6 +8,8 @@ |
| #include <string> |
| +#include "base/values.h" |
| + |
| namespace ProxyPrefs { |
| // Possible types of specifying proxy settings. Do not change the order of |
| @@ -50,4 +52,40 @@ bool StringToProxyMode(const std::string& in_value, |
| } // namespace ProxyPrefs |
| +// Factory and wrapper for proxy preferences dictionaries that are stored |
| +// in the user preferences. The dictionary has the following structure: |
| +// { |
| +// mode: string, |
| +// server: string, |
| +// pac_url: string, |
| +// bypass_list: string |
| +// } |
| +// See proxy_prefs.cc for the structure of the respective strings. |
| +class ProxyPrefsDictionary { |
|
danno
2011/02/04 10:32:13
How about putting this in the ProxyPrefs namespace
battre
2011/02/07 14:13:47
I have renamed ProxyPrefsDictionary to ProxyConfig
|
| + public: |
| + explicit ProxyPrefsDictionary(const DictionaryValue* dict); |
| + |
| + bool GetMode(ProxyPrefs::ProxyMode* out) const; |
| + bool GetPacUrl(std::string* out) const; |
| + bool GetProxyServer(std::string* out) const; |
| + bool GetBypassList(std::string* out) const; |
| + |
| + static DictionaryValue* CreateDirect(); |
| + static DictionaryValue* CreateAutoDetect(); |
| + static DictionaryValue* CreatePacScript(const std::string& pac_url); |
| + static DictionaryValue* CreateFixedServers( |
| + const std::string& proxy_server, |
| + const std::string& bypass_list); |
| + static DictionaryValue* CreateSystem(); |
| + private: |
| + static DictionaryValue* CreateDictionary(ProxyPrefs::ProxyMode mode, |
| + const std::string& pac_url, |
| + const std::string& proxy_server, |
| + const std::string& bypass_list); |
| + |
| + const DictionaryValue* dict_; // weak pointer |
|
danno
2011/02/04 10:32:13
Would it not be better/safer to copy the dictionar
battre
2011/02/07 14:13:47
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(ProxyPrefsDictionary); |
| +}; |
| + |
| #endif // CHROME_BROWSER_PREFS_PROXY_PREFS_H_ |