Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: chromeos/network/network_state_handler.cc

Issue 21030006: NetworkState cleanup, pass properties to InitialPropertiesReceived (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/network/network_state.cc ('k') | chromeos/network/network_state_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/network/network_state.cc ('k') | chromeos/network/network_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698