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

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
« no previous file with comments | « chromeos/network/network_state_handler.h ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 shill_property_handler_->SetProhibitedTechnologies(prohibited_technologies,
151 error_callback);
152 // Signal Device/Technology state changed.
153 NotifyDeviceListChanged();
154 }
155
147 const DeviceState* NetworkStateHandler::GetDeviceState( 156 const DeviceState* NetworkStateHandler::GetDeviceState(
148 const std::string& device_path) const { 157 const std::string& device_path) const {
149 const DeviceState* device = GetModifiableDeviceState(device_path); 158 const DeviceState* device = GetModifiableDeviceState(device_path);
150 if (device && !device->update_received()) 159 if (device && !device->update_received())
151 return nullptr; 160 return nullptr;
152 return device; 161 return device;
153 } 162 }
154 163
155 const DeviceState* NetworkStateHandler::GetDeviceStateByType( 164 const DeviceState* NetworkStateHandler::GetDeviceStateByType(
156 const NetworkTypePattern& type) const { 165 const NetworkTypePattern& type) const {
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 if (type.MatchesType(shill::kTypeBluetooth)) 992 if (type.MatchesType(shill::kTypeBluetooth))
984 technologies.push_back(new std::string(shill::kTypeBluetooth)); 993 technologies.push_back(new std::string(shill::kTypeBluetooth));
985 if (type.MatchesType(shill::kTypeVPN)) 994 if (type.MatchesType(shill::kTypeVPN))
986 technologies.push_back(new std::string(shill::kTypeVPN)); 995 technologies.push_back(new std::string(shill::kTypeVPN));
987 996
988 CHECK_GT(technologies.size(), 0ul); 997 CHECK_GT(technologies.size(), 0ul);
989 return technologies.Pass(); 998 return technologies.Pass();
990 } 999 }
991 1000
992 } // namespace chromeos 1001 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_state_handler.h ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698