| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ | 5 #ifndef CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ |
| 6 #define CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ | 6 #define CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // * A policy enforced proxy associated with |network_guid|. | 43 // * A policy enforced proxy associated with |network_guid|. |
| 44 // * A proxy set by an extension in the active PrefService. | 44 // * A proxy set by an extension in the active PrefService. |
| 45 // * A user specified proxy associated with |network_guid|. | 45 // * A user specified proxy associated with |network_guid|. |
| 46 void GetProxyConfig(const std::string& network_guid, UIProxyConfig* config); | 46 void GetProxyConfig(const std::string& network_guid, UIProxyConfig* config); |
| 47 | 47 |
| 48 // Called from the UI to update the user proxy configuration for | 48 // Called from the UI to update the user proxy configuration for |
| 49 // |network_guid|. The proxy specified by |config| is stored by Shill. | 49 // |network_guid|. The proxy specified by |config| is stored by Shill. |
| 50 void SetProxyConfig(const std::string& network_guid, | 50 void SetProxyConfig(const std::string& network_guid, |
| 51 const UIProxyConfig& config); | 51 const UIProxyConfig& config); |
| 52 | 52 |
| 53 // Returns true if there is a default network and it has a proxy configuration |
| 54 // with mode == MODE_FIXED_SERVERS. |
| 55 bool HasDefaultNetworkProxyConfigured(); |
| 56 |
| 53 private: | 57 private: |
| 54 // Determines effective proxy config based on prefs from config tracker, | 58 // Determines effective proxy config based on prefs from config tracker, |
| 55 // |network| and if user is using shared proxies. The effective config is | 59 // |network| and if user is using shared proxies. The effective config is |
| 56 // stored in |current_ui_config_| but not activated on network stack, and | 60 // stored in |current_ui_config_| but not activated on network stack, and |
| 57 // hence, not picked up by observers. | 61 // hence, not picked up by observers. |
| 58 void DetermineEffectiveConfig(const NetworkState& network); | 62 void DetermineEffectiveConfig(const NetworkState& network); |
| 59 | 63 |
| 60 void OnPreferenceChanged(const std::string& pref_name); | 64 void OnPreferenceChanged(const std::string& pref_name); |
| 61 | 65 |
| 62 // GUID of network used for current_ui_config_. | 66 // GUID of network used for current_ui_config_. |
| 63 std::string current_ui_network_guid_; | 67 std::string current_ui_network_guid_; |
| 64 | 68 |
| 65 // Proxy configuration for |current_ui_network_guid_|. | 69 // Proxy configuration for |current_ui_network_guid_|. |
| 66 UIProxyConfig current_ui_config_; | 70 UIProxyConfig current_ui_config_; |
| 67 | 71 |
| 68 PrefService* profile_prefs_; // unowned | 72 PrefService* profile_prefs_; // unowned |
| 69 PrefChangeRegistrar profile_registrar_; | 73 PrefChangeRegistrar profile_registrar_; |
| 70 | 74 |
| 71 PrefService* local_state_prefs_; // unowned | 75 PrefService* local_state_prefs_; // unowned |
| 72 PrefChangeRegistrar local_state_registrar_; | 76 PrefChangeRegistrar local_state_registrar_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); | 78 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 } // namespace chromeos | 81 } // namespace chromeos |
| 78 | 82 |
| 79 #endif // CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ | 83 #endif // CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ |
| OLD | NEW |