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 notification when network to be viewed is |
| 186 // changed by the UI. |
| 187 void AddNotificationCallback(base::Closure callback); |
| 188 void RemoveNotificationCallback(base::Closure callback); |
| 189 |
| 190 // PrefProxyConfigTrackerImpl implementation. |
| 191 virtual void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, |
| 192 const net::ProxyConfig& config) OVERRIDE; |
| 193 |
185 // Implementation for SignedSettings::Delegate | 194 // Implementation for SignedSettings::Delegate |
186 virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, | 195 virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, |
187 std::string value) OVERRIDE; | 196 std::string value) OVERRIDE; |
188 | 197 |
189 // NetworkLibrary::NetworkManagerObserver implementation. | 198 // NetworkLibrary::NetworkManagerObserver implementation. |
190 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; | 199 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; |
191 | 200 |
192 // NetworkLibrary::NetworkObserver implementation. | 201 // NetworkLibrary::NetworkObserver implementation. |
193 virtual void OnNetworkChanged(NetworkLibrary* cros, | 202 virtual void OnNetworkChanged(NetworkLibrary* cros, |
194 const Network* network) OVERRIDE; | 203 const Network* network) OVERRIDE; |
195 | 204 |
196 // PrefProxyConfigTrackerImpl implementation. | |
197 virtual void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, | |
198 const net::ProxyConfig& config) OVERRIDE; | |
199 | |
200 // Register UseShardProxies preference. | 205 // Register UseShardProxies preference. |
201 static void RegisterPrefs(PrefService* pref_service); | 206 static void RegisterPrefs(PrefService* pref_service); |
202 | 207 |
203 #if defined(UNIT_TEST) | 208 #if defined(UNIT_TEST) |
204 void SetTesting(ProxyConfig* test_config) { | 209 void SetTesting(ProxyConfig* test_config) { |
205 UIMakeActiveNetworkCurrent(); | 210 UIMakeActiveNetworkCurrent(); |
206 if (test_config) { | 211 if (test_config) { |
207 std::string value; | 212 std::string value; |
208 test_config->SerializeForNetwork(&value); | 213 test_config->SerializeForNetwork(&value); |
209 SetProxyConfigForNetwork(active_network_, value, false); | 214 SetProxyConfigForNetwork(active_network_, value, false); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 ProxyConfig current_ui_config_; | 291 ProxyConfig current_ui_config_; |
287 | 292 |
288 // Track changes in UseSharedProxies user preference. | 293 // Track changes in UseSharedProxies user preference. |
289 BooleanPrefMember use_shared_proxies_; | 294 BooleanPrefMember use_shared_proxies_; |
290 | 295 |
291 content::NotificationRegistrar registrar_; | 296 content::NotificationRegistrar registrar_; |
292 | 297 |
293 // Operation to retrieve proxy setting from device. | 298 // Operation to retrieve proxy setting from device. |
294 scoped_refptr<SignedSettings> retrieve_property_op_; | 299 scoped_refptr<SignedSettings> retrieve_property_op_; |
295 | 300 |
| 301 // Callbacks for notification when network to be viewed has been changed from |
| 302 // the UI. |
| 303 std::vector<base::Closure> callbacks_; |
| 304 |
296 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); | 305 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); |
297 }; | 306 }; |
298 | 307 |
299 } // namespace chromeos | 308 } // namespace chromeos |
300 | 309 |
301 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 310 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
OLD | NEW |