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_PREFS_PROXY_CONFIG_DICTIONARY_H_ | 5 #ifndef COMPONENTS_PROXY_CONFIG_PROXY_CONFIG_DICTIONARY_H_ |
6 #define CHROME_BROWSER_PREFS_PROXY_CONFIG_DICTIONARY_H_ | 6 #define COMPONENTS_PROXY_CONFIG_PROXY_CONFIG_DICTIONARY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/prefs/proxy_prefs.h" | 12 #include "components/proxy_config/proxy_config_export.h" |
| 13 #include "components/proxy_config/proxy_prefs.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class DictionaryValue; | 16 class DictionaryValue; |
16 } | 17 } |
17 | 18 |
18 // Factory and wrapper for proxy config dictionaries that are stored | 19 // Factory and wrapper for proxy config dictionaries that are stored |
19 // in the user preferences. The dictionary has the following structure: | 20 // in the user preferences. The dictionary has the following structure: |
20 // { | 21 // { |
21 // mode: string, | 22 // mode: string, |
22 // server: string, | 23 // server: string, |
23 // pac_url: string, | 24 // pac_url: string, |
24 // bypass_list: string | 25 // bypass_list: string |
25 // } | 26 // } |
26 // See proxy_config_dictionary.cc for the structure of the respective strings. | 27 // See proxy_config_dictionary.cc for the structure of the respective strings. |
27 class ProxyConfigDictionary { | 28 class PROXY_CONFIG_EXPORT ProxyConfigDictionary { |
28 public: | 29 public: |
29 // Creates a deep copy of |dict| and leaves ownership to caller. | 30 // Creates a deep copy of |dict| and leaves ownership to caller. |
30 explicit ProxyConfigDictionary(const base::DictionaryValue* dict); | 31 explicit ProxyConfigDictionary(const base::DictionaryValue* dict); |
31 ~ProxyConfigDictionary(); | 32 ~ProxyConfigDictionary(); |
32 | 33 |
33 bool GetMode(ProxyPrefs::ProxyMode* out) const; | 34 bool GetMode(ProxyPrefs::ProxyMode* out) const; |
34 bool GetPacUrl(std::string* out) const; | 35 bool GetPacUrl(std::string* out) const; |
35 bool GetPacMandatory(bool* out) const; | 36 bool GetPacMandatory(bool* out) const; |
36 bool GetProxyServer(std::string* out) const; | 37 bool GetProxyServer(std::string* out) const; |
37 bool GetBypassList(std::string* out) const; | 38 bool GetBypassList(std::string* out) const; |
(...skipping 15 matching lines...) Expand all Loading... |
53 const std::string& pac_url, | 54 const std::string& pac_url, |
54 bool pac_mandatory, | 55 bool pac_mandatory, |
55 const std::string& proxy_server, | 56 const std::string& proxy_server, |
56 const std::string& bypass_list); | 57 const std::string& bypass_list); |
57 | 58 |
58 scoped_ptr<base::DictionaryValue> dict_; | 59 scoped_ptr<base::DictionaryValue> dict_; |
59 | 60 |
60 DISALLOW_COPY_AND_ASSIGN(ProxyConfigDictionary); | 61 DISALLOW_COPY_AND_ASSIGN(ProxyConfigDictionary); |
61 }; | 62 }; |
62 | 63 |
63 #endif // CHROME_BROWSER_PREFS_PROXY_CONFIG_DICTIONARY_H_ | 64 #endif // COMPONENTS_PROXY_CONFIG_PROXY_CONFIG_DICTIONARY_H_ |
OLD | NEW |