Chromium Code Reviews| 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 bool HasDefaultNetworkProxyConfigured(); | |
|
stevenjb
2017/04/21 18:38:25
Please document:
// Returns true if there is a de
sammiequon
2017/04/21 19:02:53
Done.
| |
| 54 | |
| 53 private: | 55 private: |
| 54 // Determines effective proxy config based on prefs from config tracker, | 56 // Determines effective proxy config based on prefs from config tracker, |
| 55 // |network| and if user is using shared proxies. The effective config is | 57 // |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 | 58 // stored in |current_ui_config_| but not activated on network stack, and |
| 57 // hence, not picked up by observers. | 59 // hence, not picked up by observers. |
| 58 void DetermineEffectiveConfig(const NetworkState& network); | 60 void DetermineEffectiveConfig(const NetworkState& network); |
| 59 | 61 |
| 60 void OnPreferenceChanged(const std::string& pref_name); | 62 void OnPreferenceChanged(const std::string& pref_name); |
| 61 | 63 |
| 62 // GUID of network used for current_ui_config_. | 64 // GUID of network used for current_ui_config_. |
| 63 std::string current_ui_network_guid_; | 65 std::string current_ui_network_guid_; |
| 64 | 66 |
| 65 // Proxy configuration for |current_ui_network_guid_|. | 67 // Proxy configuration for |current_ui_network_guid_|. |
| 66 UIProxyConfig current_ui_config_; | 68 UIProxyConfig current_ui_config_; |
| 67 | 69 |
| 68 PrefService* profile_prefs_; // unowned | 70 PrefService* profile_prefs_; // unowned |
| 69 PrefChangeRegistrar profile_registrar_; | 71 PrefChangeRegistrar profile_registrar_; |
| 70 | 72 |
| 71 PrefService* local_state_prefs_; // unowned | 73 PrefService* local_state_prefs_; // unowned |
| 72 PrefChangeRegistrar local_state_registrar_; | 74 PrefChangeRegistrar local_state_registrar_; |
| 73 | 75 |
| 74 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); | 76 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace chromeos | 79 } // namespace chromeos |
| 78 | 80 |
| 79 #endif // CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ | 81 #endif // CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_SERVICE_H_ |
| OLD | NEW |