| 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 #include "chromeos/network/proxy/ui_proxy_config_service.h" | 5 #include "chromeos/network/proxy/ui_proxy_config_service.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } else if (!IsNetworkProxySettingsEditable(onc_source)) { | 194 } else if (!IsNetworkProxySettingsEditable(onc_source)) { |
| 195 current_ui_config_.state = ProxyPrefs::CONFIG_POLICY; | 195 current_ui_config_.state = ProxyPrefs::CONFIG_POLICY; |
| 196 current_ui_config_.user_modifiable = false; | 196 current_ui_config_.user_modifiable = false; |
| 197 } else { | 197 } else { |
| 198 current_ui_config_.user_modifiable = !ProxyConfigServiceImpl::IgnoreProxy( | 198 current_ui_config_.user_modifiable = !ProxyConfigServiceImpl::IgnoreProxy( |
| 199 logged_in_profile_prefs_, network.profile_path(), onc_source); | 199 logged_in_profile_prefs_, network.profile_path(), onc_source); |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 void UIProxyConfigService::OnPreferenceChanged(const std::string& pref_name) { | 203 void UIProxyConfigService::OnPreferenceChanged(const std::string& pref_name) { |
| 204 if (!current_ui_network_guid_.empty()) | 204 if (current_ui_network_guid_.empty()) |
| 205 UpdateFromPrefs(current_ui_network_guid_); | 205 return; |
| 206 const NetworkState* network = |
| 207 NetworkHandler::Get()->network_state_handler()->GetNetworkStateFromGuid( |
| 208 current_ui_network_guid_); |
| 209 if (!network) |
| 210 return; |
| 211 UpdateFromPrefs(current_ui_network_guid_); |
| 212 NetworkHandler::Get() |
| 213 ->network_state_handler() |
| 214 ->SendUpdateNotificationForNetwork(network->path()); |
| 206 } | 215 } |
| 207 | 216 |
| 208 } // namespace chromeos | 217 } // namespace chromeos |
| OLD | NEW |