Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 ~ProxyConfigServiceImpl() override; | 47 ~ProxyConfigServiceImpl() override; |
| 48 | 48 |
| 49 // PrefProxyConfigTrackerImpl implementation. | 49 // PrefProxyConfigTrackerImpl implementation. |
| 50 void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, | 50 void OnProxyConfigChanged(ProxyPrefs::ConfigState config_state, |
| 51 const net::ProxyConfig& config) override; | 51 const net::ProxyConfig& config) override; |
| 52 | 52 |
| 53 // NetworkStateHandlerObserver implementation. | 53 // NetworkStateHandlerObserver implementation. |
| 54 void DefaultNetworkChanged(const NetworkState* network) override; | 54 void DefaultNetworkChanged(const NetworkState* network) override; |
| 55 void OnShuttingDown() override; | 55 void OnShuttingDown() override; |
| 56 | 56 |
| 57 protected: | |
| 58 friend class UIProxyConfigService; | |
| 59 | |
| 60 // Returns true if proxy is to be ignored for this network profile and | 57 // Returns true if proxy is to be ignored for this network profile and |
| 61 // |onc_source|, e.g. this happens if the network is shared and | 58 // |onc_source|, e.g. this happens if the network is shared and |
| 62 // use-shared-proxies is turned off. |profile_prefs| may be NULL. | 59 // use-shared-proxies is turned off. |profile_prefs| may be NULL. |
| 63 static bool IgnoreProxy(const PrefService* profile_prefs, | 60 static bool IgnoreProxy(const PrefService* profile_prefs, |
| 64 const std::string network_profile_path, | 61 const std::string network_profile_path, |
| 65 onc::ONCSource onc_source); | 62 ::onc::ONCSource onc_source); |
| 63 | |
| 64 // Returns a proxy config dictionary of the default network. If there is no | |
| 65 // active connected network, returns the pref proxy configuration if any and | |
| 66 // NULL otherwise. | |
|
stevenjb
2016/09/12 19:59:25
This comment does not seem to be accurate. We "App
Polina Bondarenko
2016/09/12 20:49:05
Fixed a little bit. This method returns Pref Proxy
| |
| 67 // |profile_prefs| must be not NULL. | |
| 68 static std::unique_ptr<ProxyConfigDictionary> GetDefaultProxyConfigDictionary( | |
|
stevenjb
2016/09/12 19:59:25
I think that with the current logic, "Default" is
Polina Bondarenko
2016/09/12 20:49:05
Fixed.
| |
| 69 const PrefService* profile_prefs); | |
| 66 | 70 |
| 67 private: | 71 private: |
| 68 // Called when any proxy preference changes. | 72 // Called when any proxy preference changes. |
| 69 void OnProxyPrefChanged(); | 73 void OnProxyPrefChanged(); |
| 70 | 74 |
| 71 // Determines effective proxy config based on prefs from config tracker, the | 75 // Determines effective proxy config based on prefs from config tracker, the |
| 72 // current default network and if user is using shared proxies. The effective | 76 // current default network and if user is using shared proxies. The effective |
| 73 // config is stored in |active_config_| and activated on network stack, and | 77 // config is stored in |active_config_| and activated on network stack, and |
| 74 // hence, picked up by observers. | 78 // hence, picked up by observers. |
| 75 void DetermineEffectiveConfigFromDefaultNetwork(); | 79 void DetermineEffectiveConfigFromDefaultNetwork(); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 96 PrefService* local_state_prefs_; | 100 PrefService* local_state_prefs_; |
| 97 | 101 |
| 98 base::WeakPtrFactory<ProxyConfigServiceImpl> pointer_factory_; | 102 base::WeakPtrFactory<ProxyConfigServiceImpl> pointer_factory_; |
| 99 | 103 |
| 100 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); | 104 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); |
| 101 }; | 105 }; |
| 102 | 106 |
| 103 } // namespace chromeos | 107 } // namespace chromeos |
| 104 | 108 |
| 105 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 109 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
| OLD | NEW |