| 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/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 continue; | 137 continue; |
| 138 NET_LOG_USER("SetTechnologyEnabled", | 138 NET_LOG_USER("SetTechnologyEnabled", |
| 139 base::StringPrintf("%s:%d", technology->c_str(), enabled)); | 139 base::StringPrintf("%s:%d", technology->c_str(), enabled)); |
| 140 shill_property_handler_->SetTechnologyEnabled(*technology, enabled, | 140 shill_property_handler_->SetTechnologyEnabled(*technology, enabled, |
| 141 error_callback); | 141 error_callback); |
| 142 } | 142 } |
| 143 // Signal Device/Technology state changed. | 143 // Signal Device/Technology state changed. |
| 144 NotifyDeviceListChanged(); | 144 NotifyDeviceListChanged(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void NetworkStateHandler::SetProhibitedTechnologies( |
| 148 const std::vector<std::string>& prohibited_technologies, |
| 149 const network_handler::ErrorCallback& error_callback) { |
| 150 std::vector<std::string> technology_list; |
| 151 for (const std::string& prohibited_technology : prohibited_technologies) |
| 152 technology_list.push_back(prohibited_technology); |
| 153 shill_property_handler_->SetProhibitedTechnologies(technology_list, |
| 154 error_callback); |
| 155 // Signal Device/Technology state changed. |
| 156 NotifyDeviceListChanged(); |
| 157 } |
| 158 |
| 159 void NetworkStateHandler::UserPolicyApplied() { |
| 160 shill_property_handler_->UserPolicyApplied(); |
| 161 } |
| 162 |
| 147 const DeviceState* NetworkStateHandler::GetDeviceState( | 163 const DeviceState* NetworkStateHandler::GetDeviceState( |
| 148 const std::string& device_path) const { | 164 const std::string& device_path) const { |
| 149 const DeviceState* device = GetModifiableDeviceState(device_path); | 165 const DeviceState* device = GetModifiableDeviceState(device_path); |
| 150 if (device && !device->update_received()) | 166 if (device && !device->update_received()) |
| 151 return nullptr; | 167 return nullptr; |
| 152 return device; | 168 return device; |
| 153 } | 169 } |
| 154 | 170 |
| 155 const DeviceState* NetworkStateHandler::GetDeviceStateByType( | 171 const DeviceState* NetworkStateHandler::GetDeviceStateByType( |
| 156 const NetworkTypePattern& type) const { | 172 const NetworkTypePattern& type) const { |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 if (type.MatchesType(shill::kTypeBluetooth)) | 999 if (type.MatchesType(shill::kTypeBluetooth)) |
| 984 technologies.push_back(new std::string(shill::kTypeBluetooth)); | 1000 technologies.push_back(new std::string(shill::kTypeBluetooth)); |
| 985 if (type.MatchesType(shill::kTypeVPN)) | 1001 if (type.MatchesType(shill::kTypeVPN)) |
| 986 technologies.push_back(new std::string(shill::kTypeVPN)); | 1002 technologies.push_back(new std::string(shill::kTypeVPN)); |
| 987 | 1003 |
| 988 CHECK_GT(technologies.size(), 0ul); | 1004 CHECK_GT(technologies.size(), 0ul); |
| 989 return technologies.Pass(); | 1005 return technologies.Pass(); |
| 990 } | 1006 } |
| 991 | 1007 |
| 992 } // namespace chromeos | 1008 } // namespace chromeos |
| OLD | NEW |