| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // 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 |
| 58 // |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 |
| 59 // use-shared-proxies is turned off. |profile_prefs| may be NULL. | 59 // use-shared-proxies is turned off. |profile_prefs| may be NULL. |
| 60 static bool IgnoreProxy(const PrefService* profile_prefs, | 60 static bool IgnoreProxy(const PrefService* profile_prefs, |
| 61 const std::string network_profile_path, | 61 const std::string network_profile_path, |
| 62 ::onc::ONCSource onc_source); | 62 ::onc::ONCSource onc_source); |
| 63 | 63 |
| 64 // Returns Pref Proxy configuration if available or a proxy config dictionary | 64 // Returns Pref Proxy configuration if available or a proxy config dictionary |
| 65 // applied to the default network. | 65 // applied to the default network. |
| 66 // Returns NULL if no Pref Proxy configuration and no active network. | 66 // Returns null if no Pref Proxy configuration and no active network. |
| 67 // |profile_prefs| must be not NULL. | 67 // |profile_prefs| and |local_state_prefs| must be not null. |
| 68 static std::unique_ptr<ProxyConfigDictionary> GetActiveProxyConfigDictionary( | 68 static std::unique_ptr<ProxyConfigDictionary> GetActiveProxyConfigDictionary( |
| 69 const PrefService* profile_prefs); | 69 const PrefService* profile_prefs, |
| 70 const PrefService* local_state_prefs); |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 // Called when any proxy preference changes. | 73 // Called when any proxy preference changes. |
| 73 void OnProxyPrefChanged(); | 74 void OnProxyPrefChanged(); |
| 74 | 75 |
| 75 // Determines effective proxy config based on prefs from config tracker, the | 76 // Determines effective proxy config based on prefs from config tracker, the |
| 76 // current default network and if user is using shared proxies. The effective | 77 // current default network and if user is using shared proxies. The effective |
| 77 // config is stored in |active_config_| and activated on network stack, and | 78 // config is stored in |active_config_| and activated on network stack, and |
| 78 // hence, picked up by observers. | 79 // hence, picked up by observers. |
| 79 void DetermineEffectiveConfigFromDefaultNetwork(); | 80 void DetermineEffectiveConfigFromDefaultNetwork(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 100 PrefService* local_state_prefs_; | 101 PrefService* local_state_prefs_; |
| 101 | 102 |
| 102 base::WeakPtrFactory<ProxyConfigServiceImpl> pointer_factory_; | 103 base::WeakPtrFactory<ProxyConfigServiceImpl> pointer_factory_; |
| 103 | 104 |
| 104 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); | 105 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 } // namespace chromeos | 108 } // namespace chromeos |
| 108 | 109 |
| 109 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 110 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
| OLD | NEW |