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_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 bool UISetProxyConfigToDirect(); | 175 bool UISetProxyConfigToDirect(); |
176 bool UISetProxyConfigToAutoDetect(); | 176 bool UISetProxyConfigToAutoDetect(); |
177 bool UISetProxyConfigToPACScript(const GURL& pac_url); | 177 bool UISetProxyConfigToPACScript(const GURL& pac_url); |
178 bool UISetProxyConfigToSingleProxy(const net::ProxyServer& server); | 178 bool UISetProxyConfigToSingleProxy(const net::ProxyServer& server); |
179 // |scheme| is one of "http", "https", "ftp" or "socks". | 179 // |scheme| is one of "http", "https", "ftp" or "socks". |
180 bool UISetProxyConfigToProxyPerScheme(const std::string& scheme, | 180 bool UISetProxyConfigToProxyPerScheme(const std::string& scheme, |
181 const net::ProxyServer& server); | 181 const net::ProxyServer& server); |
182 // Only valid for MODE_SINGLE_PROXY or MODE_PROXY_PER_SCHEME. | 182 // Only valid for MODE_SINGLE_PROXY or MODE_PROXY_PER_SCHEME. |
183 bool UISetProxyConfigBypassRules(const net::ProxyBypassRules& bypass_rules); | 183 bool UISetProxyConfigBypassRules(const net::ProxyBypassRules& bypass_rules); |
184 | 184 |
185 // Add/Remove callback functions for network changed by the UI. | |
kuan
2011/11/10 14:27:25
s/network/notification when network to be viewed i
pastarmovj
2011/11/10 16:08:26
Done.
| |
186 void AddNotificationCallback(base::Closure callback); | |
187 void RemoveNotificationCallback(base::Closure callback); | |
188 | |
189 // PrefProxyConfigTrackerImpl implementation. | |
190 virtual void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, | |
191 const net::ProxyConfig& config) OVERRIDE; | |
192 | |
185 // Implementation for SignedSettings::Delegate | 193 // Implementation for SignedSettings::Delegate |
186 virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, | 194 virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, |
187 std::string value) OVERRIDE; | 195 std::string value) OVERRIDE; |
188 | 196 |
189 // NetworkLibrary::NetworkManagerObserver implementation. | 197 // NetworkLibrary::NetworkManagerObserver implementation. |
190 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; | 198 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; |
191 | 199 |
192 // NetworkLibrary::NetworkObserver implementation. | 200 // NetworkLibrary::NetworkObserver implementation. |
193 virtual void OnNetworkChanged(NetworkLibrary* cros, | 201 virtual void OnNetworkChanged(NetworkLibrary* cros, |
194 const Network* network) OVERRIDE; | 202 const Network* network) OVERRIDE; |
195 | 203 |
196 // PrefProxyConfigTrackerImpl implementation. | |
197 virtual void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, | |
198 const net::ProxyConfig& config) OVERRIDE; | |
199 | |
200 // Register UseShardProxies preference. | 204 // Register UseShardProxies preference. |
201 static void RegisterPrefs(PrefService* pref_service); | 205 static void RegisterPrefs(PrefService* pref_service); |
202 | 206 |
203 #if defined(UNIT_TEST) | 207 #if defined(UNIT_TEST) |
204 void SetTesting(ProxyConfig* test_config) { | 208 void SetTesting(ProxyConfig* test_config) { |
205 UIMakeActiveNetworkCurrent(); | 209 UIMakeActiveNetworkCurrent(); |
206 if (test_config) { | 210 if (test_config) { |
207 std::string value; | 211 std::string value; |
208 test_config->SerializeForNetwork(&value); | 212 test_config->SerializeForNetwork(&value); |
209 SetProxyConfigForNetwork(active_network_, value, false); | 213 SetProxyConfigForNetwork(active_network_, value, false); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 ProxyConfig current_ui_config_; | 290 ProxyConfig current_ui_config_; |
287 | 291 |
288 // Track changes in UseSharedProxies user preference. | 292 // Track changes in UseSharedProxies user preference. |
289 BooleanPrefMember use_shared_proxies_; | 293 BooleanPrefMember use_shared_proxies_; |
290 | 294 |
291 content::NotificationRegistrar registrar_; | 295 content::NotificationRegistrar registrar_; |
292 | 296 |
293 // Operation to retrieve proxy setting from device. | 297 // Operation to retrieve proxy setting from device. |
294 scoped_refptr<SignedSettings> retrieve_property_op_; | 298 scoped_refptr<SignedSettings> retrieve_property_op_; |
295 | 299 |
300 // Callbacks for notification when netowrk has been changed from the UI. | |
kuan
2011/11/10 14:27:25
s/netowrk/network to be viewed/
pastarmovj
2011/11/10 16:08:26
Done.
| |
301 std::vector<base::Closure> callbacks_; | |
302 | |
296 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); | 303 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); |
297 }; | 304 }; |
298 | 305 |
299 } // namespace chromeos | 306 } // namespace chromeos |
300 | 307 |
301 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 308 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
OLD | NEW |