OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ |
6 #define NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ | 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // Obtains host and port gconf settings and parses a proxy server | 129 // Obtains host and port gconf settings and parses a proxy server |
130 // specification from it and puts it in result. Returns true if the | 130 // specification from it and puts it in result. Returns true if the |
131 // requested variable is defined and the value valid. | 131 // requested variable is defined and the value valid. |
132 bool GetProxyFromGConf(const char* key_prefix, bool is_socks, | 132 bool GetProxyFromGConf(const char* key_prefix, bool is_socks, |
133 ProxyServer* result_server); | 133 ProxyServer* result_server); |
134 // Fills proxy config from gconf. Returns true if settings were found | 134 // Fills proxy config from gconf. Returns true if settings were found |
135 // and the configuration is valid. | 135 // and the configuration is valid. |
136 bool GetConfigFromGConf(ProxyConfig* config); | 136 bool GetConfigFromGConf(ProxyConfig* config); |
137 | 137 |
138 // Returns true if environment variables indicate that we are | |
139 // running GNOME (and therefore we want to use gconf settings). | |
140 bool ShouldTryGConf(); | |
141 | |
142 // This method is posted from the UI thread to the IO thread to | 138 // This method is posted from the UI thread to the IO thread to |
143 // carry the new config information. | 139 // carry the new config information. |
144 void SetNewProxyConfig(const ProxyConfig& new_config); | 140 void SetNewProxyConfig(const ProxyConfig& new_config); |
145 | 141 |
146 scoped_ptr<base::EnvironmentVariableGetter> env_var_getter_; | 142 scoped_ptr<base::EnvironmentVariableGetter> env_var_getter_; |
147 scoped_ptr<GConfSettingGetter> gconf_getter_; | 143 scoped_ptr<GConfSettingGetter> gconf_getter_; |
148 | 144 |
149 // Cached proxy configuration, to be returned by | 145 // Cached proxy configuration, to be returned by |
150 // GetProxyConfig. Initially populated from the UI thread, but | 146 // GetProxyConfig. Initially populated from the UI thread, but |
151 // afterwards only accessed from the IO thread. | 147 // afterwards only accessed from the IO thread. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 200 |
205 private: | 201 private: |
206 scoped_refptr<Delegate> delegate_; | 202 scoped_refptr<Delegate> delegate_; |
207 | 203 |
208 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceLinux); | 204 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceLinux); |
209 }; | 205 }; |
210 | 206 |
211 } // namespace net | 207 } // namespace net |
212 | 208 |
213 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ | 209 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ |
OLD | NEW |