| OLD | NEW |
| 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 "chrome/browser/policy/cloud_policy_service.h" | 5 #include "chrome/browser/policy/cloud_policy_service.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 8 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
| 9 | 9 |
| 10 namespace em = enterprise_management; | 10 namespace em = enterprise_management; |
| 11 | 11 |
| 12 namespace policy { | 12 namespace policy { |
| 13 | 13 |
| 14 CloudPolicyService::CloudPolicyService(scoped_ptr<CloudPolicyClient> client, | 14 CloudPolicyService::CloudPolicyService(CloudPolicyClient* client, |
| 15 CloudPolicyStore* store) | 15 CloudPolicyStore* store) |
| 16 : client_(client.Pass()), | 16 : client_(client), |
| 17 store_(store), | 17 store_(store), |
| 18 refresh_state_(REFRESH_NONE) { | 18 refresh_state_(REFRESH_NONE) { |
| 19 client_->AddObserver(this); | 19 client_->AddObserver(this); |
| 20 store_->AddObserver(this); | 20 store_->AddObserver(this); |
| 21 | 21 |
| 22 // Make sure we initialize |client_| from the policy data that might be | 22 // Make sure we initialize |client_| from the policy data that might be |
| 23 // already present in |store_|. | 23 // already present in |store_|. |
| 24 OnStoreLoaded(store_); | 24 OnStoreLoaded(store_); |
| 25 } | 25 } |
| 26 | 26 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 refresh_state_ = REFRESH_NONE; | 128 refresh_state_ = REFRESH_NONE; |
| 129 | 129 |
| 130 for (std::vector<base::Closure>::iterator callback(callbacks.begin()); | 130 for (std::vector<base::Closure>::iterator callback(callbacks.begin()); |
| 131 callback != callbacks.end(); | 131 callback != callbacks.end(); |
| 132 ++callback) { | 132 ++callback) { |
| 133 callback->Run(); | 133 callback->Run(); |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace policy | 137 } // namespace policy |
| OLD | NEW |