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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 ManagedState* managed = GetModifiableManagedState(&device_list_, device_path); | 1250 ManagedState* managed = GetModifiableManagedState(&device_list_, device_path); |
1251 if (!managed) | 1251 if (!managed) |
1252 return nullptr; | 1252 return nullptr; |
1253 return managed->AsDeviceState(); | 1253 return managed->AsDeviceState(); |
1254 } | 1254 } |
1255 | 1255 |
1256 NetworkState* NetworkStateHandler::GetModifiableNetworkState( | 1256 NetworkState* NetworkStateHandler::GetModifiableNetworkState( |
1257 const std::string& service_path) const { | 1257 const std::string& service_path) const { |
1258 ManagedState* managed = | 1258 ManagedState* managed = |
1259 GetModifiableManagedState(&network_list_, service_path); | 1259 GetModifiableManagedState(&network_list_, service_path); |
1260 if (!managed) | 1260 if (!managed) { |
1261 return nullptr; | 1261 managed = GetModifiableManagedState(&tether_network_list_, service_path); |
| 1262 if (!managed) |
| 1263 return nullptr; |
| 1264 } |
1262 return managed->AsNetworkState(); | 1265 return managed->AsNetworkState(); |
1263 } | 1266 } |
1264 | 1267 |
1265 NetworkState* NetworkStateHandler::GetModifiableNetworkStateFromGuid( | 1268 NetworkState* NetworkStateHandler::GetModifiableNetworkStateFromGuid( |
1266 const std::string& guid) const { | 1269 const std::string& guid) const { |
1267 for (auto iter = tether_network_list_.begin(); | 1270 for (auto iter = tether_network_list_.begin(); |
1268 iter != tether_network_list_.end(); ++iter) { | 1271 iter != tether_network_list_.end(); ++iter) { |
1269 NetworkState* tether_network = (*iter)->AsNetworkState(); | 1272 NetworkState* tether_network = (*iter)->AsNetworkState(); |
1270 if (tether_network->guid() == guid) | 1273 if (tether_network->guid() == guid) |
1271 return tether_network; | 1274 return tether_network; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 if (type.MatchesType(shill::kTypeVPN)) | 1414 if (type.MatchesType(shill::kTypeVPN)) |
1412 technologies.emplace_back(shill::kTypeVPN); | 1415 technologies.emplace_back(shill::kTypeVPN); |
1413 if (type.MatchesType(kTypeTether)) | 1416 if (type.MatchesType(kTypeTether)) |
1414 technologies.emplace_back(kTypeTether); | 1417 technologies.emplace_back(kTypeTether); |
1415 | 1418 |
1416 CHECK_GT(technologies.size(), 0ul); | 1419 CHECK_GT(technologies.size(), 0ul); |
1417 return technologies; | 1420 return technologies; |
1418 } | 1421 } |
1419 | 1422 |
1420 } // namespace chromeos | 1423 } // namespace chromeos |
OLD | NEW |