| 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 17 matching lines...) Expand all Loading... |
| 28 // on chromeos device from chromeos revisions before migration to flimflam, | 28 // on chromeos device from chromeos revisions before migration to flimflam, |
| 29 // - persists proxy setting per network in flimflim | 29 // - persists proxy setting per network in flimflim |
| 30 // - provides network stack with latest effective proxy configuration for | 30 // - provides network stack with latest effective proxy configuration for |
| 31 // currently active network via PrefProxyConfigTrackerImpl's mechanism of | 31 // currently active network via PrefProxyConfigTrackerImpl's mechanism of |
| 32 // pushing config to ChromeProxyConfigService | 32 // pushing config to ChromeProxyConfigService |
| 33 // - provides UI with methods to retrieve and modify proxy configuration for | 33 // - provides UI with methods to retrieve and modify proxy configuration for |
| 34 // any remembered network (either currently active or non-active) of current | 34 // any remembered network (either currently active or non-active) of current |
| 35 // user profile | 35 // user profile |
| 36 class ProxyConfigServiceImpl | 36 class ProxyConfigServiceImpl |
| 37 : public PrefProxyConfigTrackerImpl, | 37 : public PrefProxyConfigTrackerImpl, |
| 38 public SignedSettings::Delegate<std::string>, | 38 public SignedSettings::Delegate<const base::Value*>, |
| 39 public NetworkLibrary::NetworkManagerObserver, | 39 public NetworkLibrary::NetworkManagerObserver, |
| 40 public NetworkLibrary::NetworkObserver { | 40 public NetworkLibrary::NetworkObserver { |
| 41 public: | 41 public: |
| 42 // ProxyConfigServiceImpl is created in ProxyServiceFactory:: | 42 // ProxyConfigServiceImpl is created in ProxyServiceFactory:: |
| 43 // CreatePrefProxyConfigTrackerImpl via Profile::GetProxyConfigTracker() for | 43 // CreatePrefProxyConfigTrackerImpl via Profile::GetProxyConfigTracker() for |
| 44 // profile or IOThread constructor for local state and is owned by the | 44 // profile or IOThread constructor for local state and is owned by the |
| 45 // respective classes. | 45 // respective classes. |
| 46 // | 46 // |
| 47 // From the UI, it is accessed via Profile::GetProxyConfigTracker to allow | 47 // From the UI, it is accessed via Profile::GetProxyConfigTracker to allow |
| 48 // user to read or modify the proxy configuration via UIGetProxyConfig or | 48 // user to read or modify the proxy configuration via UIGetProxyConfig or |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // changed by the UI. | 186 // changed by the UI. |
| 187 void AddNotificationCallback(base::Closure callback); | 187 void AddNotificationCallback(base::Closure callback); |
| 188 void RemoveNotificationCallback(base::Closure callback); | 188 void RemoveNotificationCallback(base::Closure callback); |
| 189 | 189 |
| 190 // PrefProxyConfigTrackerImpl implementation. | 190 // PrefProxyConfigTrackerImpl implementation. |
| 191 virtual void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, | 191 virtual void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, |
| 192 const net::ProxyConfig& config) OVERRIDE; | 192 const net::ProxyConfig& config) OVERRIDE; |
| 193 | 193 |
| 194 // Implementation for SignedSettings::Delegate | 194 // Implementation for SignedSettings::Delegate |
| 195 virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, | 195 virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, |
| 196 std::string value) OVERRIDE; | 196 const base::Value* value) OVERRIDE; |
| 197 | 197 |
| 198 // NetworkLibrary::NetworkManagerObserver implementation. | 198 // NetworkLibrary::NetworkManagerObserver implementation. |
| 199 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; | 199 virtual void OnNetworkManagerChanged(NetworkLibrary* cros) OVERRIDE; |
| 200 | 200 |
| 201 // NetworkLibrary::NetworkObserver implementation. | 201 // NetworkLibrary::NetworkObserver implementation. |
| 202 virtual void OnNetworkChanged(NetworkLibrary* cros, | 202 virtual void OnNetworkChanged(NetworkLibrary* cros, |
| 203 const Network* network) OVERRIDE; | 203 const Network* network) OVERRIDE; |
| 204 | 204 |
| 205 // Register UseShardProxies preference. | 205 // Register UseShardProxies preference. |
| 206 static void RegisterPrefs(PrefService* pref_service); | 206 static void RegisterPrefs(PrefService* pref_service); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 // Callbacks for notification when network to be viewed has been changed from | 301 // Callbacks for notification when network to be viewed has been changed from |
| 302 // the UI. | 302 // the UI. |
| 303 std::vector<base::Closure> callbacks_; | 303 std::vector<base::Closure> callbacks_; |
| 304 | 304 |
| 305 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); | 305 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 } // namespace chromeos | 308 } // namespace chromeos |
| 309 | 309 |
| 310 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 310 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
| OLD | NEW |