| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 prev_connection_state = managed->AsNetworkState()->connection_state(); | 449 prev_connection_state = managed->AsNetworkState()->connection_state(); |
| 450 for (base::DictionaryValue::Iterator iter(properties); | 450 for (base::DictionaryValue::Iterator iter(properties); |
| 451 !iter.IsAtEnd(); iter.Advance()) { | 451 !iter.IsAtEnd(); iter.Advance()) { |
| 452 if (type == ManagedState::MANAGED_TYPE_NETWORK) { | 452 if (type == ManagedState::MANAGED_TYPE_NETWORK) { |
| 453 if (managed->PropertyChanged(iter.key(), iter.value())) | 453 if (managed->PropertyChanged(iter.key(), iter.value())) |
| 454 network_property_updated = true; | 454 network_property_updated = true; |
| 455 } else { | 455 } else { |
| 456 managed->PropertyChanged(iter.key(), iter.value()); | 456 managed->PropertyChanged(iter.key(), iter.value()); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 managed->InitialPropertiesReceived(); | 459 network_property_updated |= managed->InitialPropertiesReceived(properties); |
| 460 NET_LOG_DEBUG("PropertiesReceived", GetManagedStateLogName(managed)); | 460 NET_LOG_DEBUG("PropertiesReceived", GetManagedStateLogName(managed)); |
| 461 // Notify observers. | 461 // Notify observers. |
| 462 if (network_property_updated || managed->update_requested()) { | 462 if (network_property_updated || managed->update_requested()) { |
| 463 NetworkState* network = managed->AsNetworkState(); | 463 NetworkState* network = managed->AsNetworkState(); |
| 464 DCHECK(network); | 464 DCHECK(network); |
| 465 // Signal connection state changed after all properties have been updated. | 465 // Signal connection state changed after all properties have been updated. |
| 466 if (ConnectionStateChanged(network, prev_connection_state)) { | 466 if (ConnectionStateChanged(network, prev_connection_state)) { |
| 467 OnNetworkConnectionStateChanged(network); | 467 OnNetworkConnectionStateChanged(network); |
| 468 // If the network did not already have a profile entry, refresh favorites. | 468 // If the network did not already have a profile entry, refresh favorites. |
| 469 if (network->profile_path().empty()) | 469 if (network->profile_path().empty()) |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 } | 690 } |
| 691 if (type == kMatchTypeDefault || type == kMatchTypeNonVirtual || | 691 if (type == kMatchTypeDefault || type == kMatchTypeNonVirtual || |
| 692 type == kMatchTypeWireless) { | 692 type == kMatchTypeWireless) { |
| 693 NOTREACHED(); | 693 NOTREACHED(); |
| 694 return flimflam::kTypeWifi; | 694 return flimflam::kTypeWifi; |
| 695 } | 695 } |
| 696 return type; | 696 return type; |
| 697 } | 697 } |
| 698 | 698 |
| 699 } // namespace chromeos | 699 } // namespace chromeos |
| OLD | NEW |