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

Side by Side Diff: components/policy/core/common/cloud/cloud_policy_manager.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 "components/policy/core/common/cloud/cloud_policy_manager.h" 5 #include "components/policy/core/common/cloud/cloud_policy_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 16 matching lines...) Expand all
27 const std::string& settings_entity_id, 27 const std::string& settings_entity_id,
28 CloudPolicyStore* cloud_policy_store, 28 CloudPolicyStore* cloud_policy_store,
29 const scoped_refptr<base::SequencedTaskRunner>& task_runner, 29 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
30 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, 30 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner,
31 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) 31 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner)
32 : core_(policy_type, settings_entity_id, cloud_policy_store, task_runner), 32 : core_(policy_type, settings_entity_id, cloud_policy_store, task_runner),
33 waiting_for_policy_refresh_(false), 33 waiting_for_policy_refresh_(false),
34 file_task_runner_(file_task_runner), 34 file_task_runner_(file_task_runner),
35 io_task_runner_(io_task_runner) { 35 io_task_runner_(io_task_runner) {
36 store()->AddObserver(this); 36 store()->AddObserver(this);
37 source_ = POLICY_SOURCE_CLOUD;
bartfab (slow) 2015/09/14 14:42:26 Nit 1: #include "components/policy/core/common/pol
fhorschig 2015/09/16 13:52:04 Done.
37 38
38 // If the underlying store is already initialized, publish the loaded 39 // If the underlying store is already initialized, publish the loaded
39 // policy. Otherwise, request a load now. 40 // policy. Otherwise, request a load now.
40 if (store()->is_initialized()) 41 if (store()->is_initialized())
41 CheckAndPublishPolicy(); 42 CheckAndPublishPolicy();
42 else 43 else
43 store()->Load(); 44 store()->Load();
44 } 45 }
45 46
46 CloudPolicyManager::~CloudPolicyManager() {} 47 CloudPolicyManager::~CloudPolicyManager() {}
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 151 }
151 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) 152 #endif // !defined(OS_ANDROID) && !defined(OS_IOS)
152 } 153 }
153 154
154 void CloudPolicyManager::OnRefreshComplete(bool success) { 155 void CloudPolicyManager::OnRefreshComplete(bool success) {
155 waiting_for_policy_refresh_ = false; 156 waiting_for_policy_refresh_ = false;
156 CheckAndPublishPolicy(); 157 CheckAndPublishPolicy();
157 } 158 }
158 159
159 } // namespace policy 160 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698