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

Side by Side Diff: extensions/browser/api/networking_private/networking_private_service_client.cc

Issue 1059033002: Implement networkingPrivate.getDeviceStates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 8 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/api/networking_private/networking_private_service_c lient.h" 5 #include "extensions/browser/api/networking_private/networking_private_service_c lient.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "base/threading/worker_pool.h" 10 #include "base/threading/worker_pool.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 void NetworkingPrivateServiceClient::GetCaptivePortalStatus( 306 void NetworkingPrivateServiceClient::GetCaptivePortalStatus(
307 const std::string& guid, 307 const std::string& guid,
308 const StringCallback& success_callback, 308 const StringCallback& success_callback,
309 const FailureCallback& failure_callback) { 309 const FailureCallback& failure_callback) {
310 failure_callback.Run(networking_private::kErrorNotSupported); 310 failure_callback.Run(networking_private::kErrorNotSupported);
311 } 311 }
312 312
313 scoped_ptr<base::ListValue> 313 scoped_ptr<base::ListValue>
314 NetworkingPrivateServiceClient::GetEnabledNetworkTypes() { 314 NetworkingPrivateServiceClient::GetEnabledNetworkTypes() {
315 scoped_ptr<base::ListValue> network_list; 315 scoped_ptr<base::ListValue> network_list;
316 network_list->AppendString(::onc::network_type::kWiFi);
316 return network_list.Pass(); 317 return network_list.Pass();
317 } 318 }
318 319
320 scoped_ptr<DeviceStateMap> NetworkingPrivateServiceClient::GetDeviceStates() {
321 scoped_ptr<DeviceStateMap> device_list(new DeviceStateMap);
322 device_list[ ::onc::network_type::kWiFi] = ::onc::device_state::kEnabled;
323 return device_list.Pass();
324 }
325
319 bool NetworkingPrivateServiceClient::EnableNetworkType( 326 bool NetworkingPrivateServiceClient::EnableNetworkType(
320 const std::string& type) { 327 const std::string& type) {
321 return false; 328 return false;
322 } 329 }
323 330
324 bool NetworkingPrivateServiceClient::DisableNetworkType( 331 bool NetworkingPrivateServiceClient::DisableNetworkType(
325 const std::string& type) { 332 const std::string& type) {
326 return false; 333 return false;
327 } 334 }
328 335
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 440
434 void NetworkingPrivateServiceClient::OnNetworkListChangedEventOnUIThread( 441 void NetworkingPrivateServiceClient::OnNetworkListChangedEventOnUIThread(
435 const std::vector<std::string>& network_guids) { 442 const std::vector<std::string>& network_guids) {
436 DCHECK_CURRENTLY_ON(BrowserThread::UI); 443 DCHECK_CURRENTLY_ON(BrowserThread::UI);
437 FOR_EACH_OBSERVER(NetworkingPrivateDelegateObserver, 444 FOR_EACH_OBSERVER(NetworkingPrivateDelegateObserver,
438 network_events_observers_, 445 network_events_observers_,
439 OnNetworkListChangedEvent(network_guids)); 446 OnNetworkListChangedEvent(network_guids));
440 } 447 }
441 448
442 } // namespace extensions 449 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698