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

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

Issue 1454773002: Play better with C++11 library features from /chromeos (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/managed_network_configuration_handler_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chromeos/network/managed_network_configuration_handler_impl.h" 5 #include "chromeos/network/managed_network_configuration_handler_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 << "."; 415 << ".";
416 416
417 // |userhash| must be empty for device policies. 417 // |userhash| must be empty for device policies.
418 DCHECK(onc_source != ::onc::ONC_SOURCE_DEVICE_POLICY || 418 DCHECK(onc_source != ::onc::ONC_SOURCE_DEVICE_POLICY ||
419 userhash.empty()); 419 userhash.empty());
420 Policies* policies = NULL; 420 Policies* policies = NULL;
421 if (ContainsKey(policies_by_user_, userhash)) { 421 if (ContainsKey(policies_by_user_, userhash)) {
422 policies = policies_by_user_[userhash].get(); 422 policies = policies_by_user_[userhash].get();
423 } else { 423 } else {
424 policies = new Policies; 424 policies = new Policies;
425 policies_by_user_[userhash] = make_linked_ptr(policies); 425 policies_by_user_[userhash] = make_scoped_ptr(policies);
426 } 426 }
427 427
428 policies->global_network_config.MergeDictionary(&global_network_config); 428 policies->global_network_config.MergeDictionary(&global_network_config);
429 429
430 // Update prohibited technologies. 430 // Update prohibited technologies.
431 const base::ListValue* prohibited_list = nullptr; 431 const base::ListValue* prohibited_list = nullptr;
432 if (policies->global_network_config.GetListWithoutPathExpansion( 432 if (policies->global_network_config.GetListWithoutPathExpansion(
433 ::onc::global_network_config::kDisableNetworkTypes, 433 ::onc::global_network_config::kDisableNetworkTypes,
434 &prohibited_list) && 434 &prohibited_list) &&
435 prohibited_technologies_handler_) { 435 prohibited_technologies_handler_) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 const Policies* policies = policies_by_user_[userhash].get(); 509 const Policies* policies = policies_by_user_[userhash].get();
510 DCHECK(policies); 510 DCHECK(policies);
511 511
512 PolicyApplicator* applicator = 512 PolicyApplicator* applicator =
513 new PolicyApplicator(*profile, 513 new PolicyApplicator(*profile,
514 policies->per_network_config, 514 policies->per_network_config,
515 policies->global_network_config, 515 policies->global_network_config,
516 this, 516 this,
517 modified_policies); 517 modified_policies);
518 policy_applicators_[userhash] = make_linked_ptr(applicator); 518 policy_applicators_[userhash] = make_scoped_ptr(applicator);
519 applicator->Run(); 519 applicator->Run();
520 return true; 520 return true;
521 } 521 }
522 522
523 void ManagedNetworkConfigurationHandlerImpl::OnProfileAdded( 523 void ManagedNetworkConfigurationHandlerImpl::OnProfileAdded(
524 const NetworkProfile& profile) { 524 const NetworkProfile& profile) {
525 VLOG(1) << "Adding profile " << profile.ToDebugString() << "'."; 525 VLOG(1) << "Adding profile " << profile.ToDebugString() << "'.";
526 526
527 const Policies* policies = GetPoliciesForProfile(profile); 527 const Policies* policies = GetPoliciesForProfile(profile);
528 if (!policies) { 528 if (!policies) {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 scoped_ptr<base::DictionaryValue> network_properties, 859 scoped_ptr<base::DictionaryValue> network_properties,
860 GetDevicePropertiesCallback send_callback, 860 GetDevicePropertiesCallback send_callback,
861 const std::string& error_name, 861 const std::string& error_name,
862 scoped_ptr<base::DictionaryValue> error_data) { 862 scoped_ptr<base::DictionaryValue> error_data) {
863 NET_LOG_ERROR("Error getting device properties", service_path); 863 NET_LOG_ERROR("Error getting device properties", service_path);
864 send_callback.Run(service_path, network_properties.Pass()); 864 send_callback.Run(service_path, network_properties.Pass());
865 } 865 }
866 866
867 867
868 } // namespace chromeos 868 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/managed_network_configuration_handler_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698