| 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 #include "chromeos/network/network_state_handler.h" | 5 #include "chromeos/network/network_state_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 void NetworkStateHandler::UpdateIPConfigProperties( | 673 void NetworkStateHandler::UpdateIPConfigProperties( |
| 674 ManagedState::ManagedType type, | 674 ManagedState::ManagedType type, |
| 675 const std::string& path, | 675 const std::string& path, |
| 676 const std::string& ip_config_path, | 676 const std::string& ip_config_path, |
| 677 const base::DictionaryValue& properties) { | 677 const base::DictionaryValue& properties) { |
| 678 if (type == ManagedState::MANAGED_TYPE_NETWORK) { | 678 if (type == ManagedState::MANAGED_TYPE_NETWORK) { |
| 679 NetworkState* network = GetModifiableNetworkState(path); | 679 NetworkState* network = GetModifiableNetworkState(path); |
| 680 if (!network) | 680 if (!network) |
| 681 return; | 681 return; |
| 682 network->IPConfigPropertiesChanged(properties); | 682 network->IPConfigPropertiesChanged(properties); |
| 683 if (network->path() == default_network_path_) |
| 684 NotifyDefaultNetworkChanged(network); |
| 683 } else if (type == ManagedState::MANAGED_TYPE_DEVICE) { | 685 } else if (type == ManagedState::MANAGED_TYPE_DEVICE) { |
| 684 DeviceState* device = GetModifiableDeviceState(path); | 686 DeviceState* device = GetModifiableDeviceState(path); |
| 685 if (!device) | 687 if (!device) |
| 686 return; | 688 return; |
| 687 device->IPConfigPropertiesChanged(ip_config_path, properties); | 689 device->IPConfigPropertiesChanged(ip_config_path, properties); |
| 690 if (!default_network_path_.empty()) { |
| 691 const NetworkState* default_network = |
| 692 GetNetworkState(default_network_path_); |
| 693 if (default_network && default_network->device_path() == path) |
| 694 NotifyDefaultNetworkChanged(default_network); |
| 695 } |
| 688 } | 696 } |
| 689 } | 697 } |
| 690 | 698 |
| 691 void NetworkStateHandler::CheckPortalListChanged( | 699 void NetworkStateHandler::CheckPortalListChanged( |
| 692 const std::string& check_portal_list) { | 700 const std::string& check_portal_list) { |
| 693 check_portal_list_ = check_portal_list; | 701 check_portal_list_ = check_portal_list; |
| 694 } | 702 } |
| 695 | 703 |
| 696 void NetworkStateHandler::TechnologyListChanged() { | 704 void NetworkStateHandler::TechnologyListChanged() { |
| 697 // Eventually we would like to replace Technology state with Device state. | 705 // Eventually we would like to replace Technology state with Device state. |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 if (type.MatchesType(shill::kTypeBluetooth)) | 969 if (type.MatchesType(shill::kTypeBluetooth)) |
| 962 technologies.push_back(new std::string(shill::kTypeBluetooth)); | 970 technologies.push_back(new std::string(shill::kTypeBluetooth)); |
| 963 if (type.MatchesType(shill::kTypeVPN)) | 971 if (type.MatchesType(shill::kTypeVPN)) |
| 964 technologies.push_back(new std::string(shill::kTypeVPN)); | 972 technologies.push_back(new std::string(shill::kTypeVPN)); |
| 965 | 973 |
| 966 CHECK_GT(technologies.size(), 0ul); | 974 CHECK_GT(technologies.size(), 0ul); |
| 967 return technologies.Pass(); | 975 return technologies.Pass(); |
| 968 } | 976 } |
| 969 | 977 |
| 970 } // namespace chromeos | 978 } // namespace chromeos |
| OLD | NEW |