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

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

Issue 332713003: Fix FirstNetworkByType, and some minor debugging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
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/guid.h" 9 #include "base/guid.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 const NetworkState* NetworkStateHandler::FirstNetworkByType( 216 const NetworkState* NetworkStateHandler::FirstNetworkByType(
217 const NetworkTypePattern& type) const { 217 const NetworkTypePattern& type) const {
218 for (ManagedStateList::const_iterator iter = network_list_.begin(); 218 for (ManagedStateList::const_iterator iter = network_list_.begin();
219 iter != network_list_.end(); ++iter) { 219 iter != network_list_.end(); ++iter) {
220 const NetworkState* network = (*iter)->AsNetworkState(); 220 const NetworkState* network = (*iter)->AsNetworkState();
221 DCHECK(network); 221 DCHECK(network);
222 if (!network->update_received()) 222 if (!network->update_received())
223 continue; 223 continue;
224 if (!network->visible()) 224 if (!network->visible())
225 break; 225 continue;
226 if (network->Matches(type)) 226 if (network->Matches(type))
227 return network; 227 return network;
228 } 228 }
229 return NULL; 229 return NULL;
230 } 230 }
231 231
232 std::string NetworkStateHandler::FormattedHardwareAddressForType( 232 std::string NetworkStateHandler::FormattedHardwareAddressForType(
233 const NetworkTypePattern& type) const { 233 const NetworkTypePattern& type) const {
234 const DeviceState* device = NULL; 234 const DeviceState* device = NULL;
235 const NetworkState* network = ConnectedNetworkByType(type); 235 const NetworkState* network = ConnectedNetworkByType(type);
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 if (type.MatchesType(shill::kTypeBluetooth)) 910 if (type.MatchesType(shill::kTypeBluetooth))
911 technologies.push_back(new std::string(shill::kTypeBluetooth)); 911 technologies.push_back(new std::string(shill::kTypeBluetooth));
912 if (type.MatchesType(shill::kTypeVPN)) 912 if (type.MatchesType(shill::kTypeVPN))
913 technologies.push_back(new std::string(shill::kTypeVPN)); 913 technologies.push_back(new std::string(shill::kTypeVPN));
914 914
915 CHECK_GT(technologies.size(), 0ul); 915 CHECK_GT(technologies.size(), 0ul);
916 return technologies.Pass(); 916 return technologies.Pass();
917 } 917 }
918 918
919 } // namespace chromeos 919 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/network_ui/network_ui.js ('k') | chromeos/network/network_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698