| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void NetworkStateHandler::SetTechnologyEnabled( | 151 void NetworkStateHandler::SetTechnologyEnabled( |
| 152 const NetworkTypePattern& type, | 152 const NetworkTypePattern& type, |
| 153 bool enabled, | 153 bool enabled, |
| 154 const network_handler::ErrorCallback& error_callback) { | 154 const network_handler::ErrorCallback& error_callback) { |
| 155 std::vector<std::string> technologies = GetTechnologiesForType(type); | 155 std::vector<std::string> technologies = GetTechnologiesForType(type); |
| 156 for (const std::string& technology : technologies) { | 156 for (const std::string& technology : technologies) { |
| 157 if (technology == kTypeTether) { | 157 if (technology == kTypeTether) { |
| 158 if (tether_technology_state_ != TECHNOLOGY_ENABLED && | 158 if (tether_technology_state_ != TECHNOLOGY_ENABLED && |
| 159 tether_technology_state_ != TECHNOLOGY_AVAILABLE) { | 159 tether_technology_state_ != TECHNOLOGY_AVAILABLE) { |
| 160 NET_LOG(ERROR) << "SetTechnologyEnabled() called for the Tether " | 160 NET_LOG(ERROR) << "SetTechnologyEnabled() called for the Tether " |
| 161 << "DeviceState, but the current state was not " | 161 << "DeviceState, but the current state was: " |
| 162 << "TECHNOLOGY_ENABLED or TECHNOLOGY_AVAILABLE."; | 162 << tether_technology_state_; |
| 163 network_handler::RunErrorCallback( | 163 network_handler::RunErrorCallback( |
| 164 error_callback, kTetherDevicePath, | 164 error_callback, kTetherDevicePath, |
| 165 NetworkConnectionHandler::kErrorEnabledOrDisabledWhenNotAvailable, | 165 NetworkConnectionHandler::kErrorEnabledOrDisabledWhenNotAvailable, |
| 166 ""); | 166 ""); |
| 167 continue; | 167 continue; |
| 168 } | 168 } |
| 169 | 169 |
| 170 // Tether does not exist in Shill, so set |tether_technology_state_| and | 170 // Tether does not exist in Shill, so set |tether_technology_state_| and |
| 171 // skip the below interactions with |shill_property_handler_|. | 171 // skip the below interactions with |shill_property_handler_|. |
| 172 tether_technology_state_ = | 172 tether_technology_state_ = |
| (...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 if (type.MatchesType(shill::kTypeVPN)) | 1482 if (type.MatchesType(shill::kTypeVPN)) |
| 1483 technologies.emplace_back(shill::kTypeVPN); | 1483 technologies.emplace_back(shill::kTypeVPN); |
| 1484 if (type.MatchesType(kTypeTether)) | 1484 if (type.MatchesType(kTypeTether)) |
| 1485 technologies.emplace_back(kTypeTether); | 1485 technologies.emplace_back(kTypeTether); |
| 1486 | 1486 |
| 1487 CHECK_GT(technologies.size(), 0ul); | 1487 CHECK_GT(technologies.size(), 0ul); |
| 1488 return technologies; | 1488 return technologies; |
| 1489 } | 1489 } |
| 1490 | 1490 |
| 1491 } // namespace chromeos | 1491 } // namespace chromeos |
| OLD | NEW |