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

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

Issue 1431563005: Handle prohibited technologies in device policy ONC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
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/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
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);
stevenjb 2015/11/11 18:07:31 Why are we copying a vector<string> to a vector<st
fqj 2015/11/12 10:23:01 Done.
153 shill_property_handler_->SetProhibitedTechnologies(technology_list,
154 error_callback);
155 // Signal Device/Technology state changed.
156 NotifyDeviceListChanged();
157 }
158
147 const DeviceState* NetworkStateHandler::GetDeviceState( 159 const DeviceState* NetworkStateHandler::GetDeviceState(
148 const std::string& device_path) const { 160 const std::string& device_path) const {
149 const DeviceState* device = GetModifiableDeviceState(device_path); 161 const DeviceState* device = GetModifiableDeviceState(device_path);
150 if (device && !device->update_received()) 162 if (device && !device->update_received())
151 return nullptr; 163 return nullptr;
152 return device; 164 return device;
153 } 165 }
154 166
155 const DeviceState* NetworkStateHandler::GetDeviceStateByType( 167 const DeviceState* NetworkStateHandler::GetDeviceStateByType(
156 const NetworkTypePattern& type) const { 168 const NetworkTypePattern& type) const {
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 if (type.MatchesType(shill::kTypeBluetooth)) 995 if (type.MatchesType(shill::kTypeBluetooth))
984 technologies.push_back(new std::string(shill::kTypeBluetooth)); 996 technologies.push_back(new std::string(shill::kTypeBluetooth));
985 if (type.MatchesType(shill::kTypeVPN)) 997 if (type.MatchesType(shill::kTypeVPN))
986 technologies.push_back(new std::string(shill::kTypeVPN)); 998 technologies.push_back(new std::string(shill::kTypeVPN));
987 999
988 CHECK_GT(technologies.size(), 0ul); 1000 CHECK_GT(technologies.size(), 0ul);
989 return technologies.Pass(); 1001 return technologies.Pass();
990 } 1002 }
991 1003
992 } // namespace chromeos 1004 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698