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

Side by Side Diff: chrome/browser/policy/cloud_policy_service.cc

Issue 10919131: Break out base functionality of UserCloudPolicyManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, address comments, fix compilation. Created 8 years, 3 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 | Annotate | Revision Log
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 "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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698