| OLD | NEW |
| 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/policy_applicator.h" | 5 #include "chromeos/network/policy_applicator.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 : handler_(handler), profile_(profile), weak_ptr_factory_(this) { | 53 : handler_(handler), profile_(profile), weak_ptr_factory_(this) { |
| 54 global_network_config_.MergeDictionary(&global_network_config); | 54 global_network_config_.MergeDictionary(&global_network_config); |
| 55 remaining_policies_.swap(*modified_policies); | 55 remaining_policies_.swap(*modified_policies); |
| 56 for (GuidToPolicyMap::const_iterator it = all_policies.begin(); | 56 for (GuidToPolicyMap::const_iterator it = all_policies.begin(); |
| 57 it != all_policies.end(); ++it) { | 57 it != all_policies.end(); ++it) { |
| 58 all_policies_.insert(std::make_pair(it->first, it->second->DeepCopy())); | 58 all_policies_.insert(std::make_pair(it->first, it->second->DeepCopy())); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 PolicyApplicator::~PolicyApplicator() { | 62 PolicyApplicator::~PolicyApplicator() { |
| 63 STLDeleteValues(&all_policies_); | 63 base::STLDeleteValues(&all_policies_); |
| 64 VLOG(1) << "Destroying PolicyApplicator for " << profile_.userhash; | 64 VLOG(1) << "Destroying PolicyApplicator for " << profile_.userhash; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void PolicyApplicator::Run() { | 67 void PolicyApplicator::Run() { |
| 68 DBusThreadManager::Get()->GetShillProfileClient()->GetProperties( | 68 DBusThreadManager::Get()->GetShillProfileClient()->GetProperties( |
| 69 dbus::ObjectPath(profile_.path), | 69 dbus::ObjectPath(profile_.path), |
| 70 base::Bind(&PolicyApplicator::GetProfilePropertiesCallback, | 70 base::Bind(&PolicyApplicator::GetProfilePropertiesCallback, |
| 71 weak_ptr_factory_.GetWeakPtr()), | 71 weak_ptr_factory_.GetWeakPtr()), |
| 72 base::Bind(&PolicyApplicator::GetProfilePropertiesError, | 72 base::Bind(&PolicyApplicator::GetProfilePropertiesError, |
| 73 weak_ptr_factory_.GetWeakPtr())); | 73 weak_ptr_factory_.GetWeakPtr())); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 } | 335 } |
| 336 remaining_policies_.clear(); | 336 remaining_policies_.clear(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void PolicyApplicator::NotifyConfigurationHandlerAndFinish() { | 339 void PolicyApplicator::NotifyConfigurationHandlerAndFinish() { |
| 340 weak_ptr_factory_.InvalidateWeakPtrs(); | 340 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 341 handler_->OnPoliciesApplied(profile_); | 341 handler_->OnPoliciesApplied(profile_); |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace chromeos | 344 } // namespace chromeos |
| OLD | NEW |