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

Side by Side Diff: chrome/browser/policy/cloud/cloud_policy_manager.cc

Issue 86003002: Enable cloud policy for extensions by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/cloud_policy_manager.h" 5 #include "chrome/browser/policy/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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 void CloudPolicyManager::CreateComponentCloudPolicyService( 104 void CloudPolicyManager::CreateComponentCloudPolicyService(
105 const base::FilePath& policy_cache_path, 105 const base::FilePath& policy_cache_path,
106 const scoped_refptr<net::URLRequestContextGetter>& request_context) { 106 const scoped_refptr<net::URLRequestContextGetter>& request_context) {
107 #if !defined(OS_ANDROID) && !defined(OS_IOS) 107 #if !defined(OS_ANDROID) && !defined(OS_IOS)
108 // Init() must have been called. 108 // Init() must have been called.
109 DCHECK(schema_registry()); 109 DCHECK(schema_registry());
110 // Called at most once. 110 // Called at most once.
111 DCHECK(!component_policy_service_); 111 DCHECK(!component_policy_service_);
112 112
113 if (!CommandLine::ForCurrentProcess()->HasSwitch( 113 if (CommandLine::ForCurrentProcess()->HasSwitch(
114 switches::kEnableComponentCloudPolicy) || 114 switches::kDisableComponentCloudPolicy) ||
115 policy_cache_path.empty()) { 115 policy_cache_path.empty()) {
116 return; 116 return;
117 } 117 }
118 118
119 // TODO(joaodasilva): Move the |file_task_runner_| to the blocking pool. 119 // TODO(joaodasilva): Move the |file_task_runner_| to the blocking pool.
120 // Currently it's not possible because the ComponentCloudPolicyStore is 120 // Currently it's not possible because the ComponentCloudPolicyStore is
121 // NonThreadSafe and doesn't support getting calls from different threads. 121 // NonThreadSafe and doesn't support getting calls from different threads.
122 scoped_ptr<ResourceCache> resource_cache( 122 scoped_ptr<ResourceCache> resource_cache(
123 new ResourceCache(policy_cache_path, file_task_runner_)); 123 new ResourceCache(policy_cache_path, file_task_runner_));
124 component_policy_service_.reset(new ComponentCloudPolicyService( 124 component_policy_service_.reset(new ComponentCloudPolicyService(
125 this, 125 this,
126 schema_registry(), 126 schema_registry(),
127 core(), 127 core(),
128 resource_cache.Pass(), 128 resource_cache.Pass(),
129 request_context, 129 request_context,
130 file_task_runner_, 130 file_task_runner_,
131 io_task_runner_)); 131 io_task_runner_));
132 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) 132 #endif // !defined(OS_ANDROID) && !defined(OS_IOS)
133 } 133 }
134 134
135 void CloudPolicyManager::OnRefreshComplete(bool success) { 135 void CloudPolicyManager::OnRefreshComplete(bool success) {
136 waiting_for_policy_refresh_ = false; 136 waiting_for_policy_refresh_ = false;
137 CheckAndPublishPolicy(); 137 CheckAndPublishPolicy();
138 } 138 }
139 139
140 } // namespace policy 140 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698