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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_policy_service.cc

Issue 337053005: Precache policy-for-extensions for device-local accounts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/chromeos/policy/device_local_account_policy_service.h" 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 DeviceLocalAccountPolicyBroker::DeviceLocalAccountPolicyBroker( 117 DeviceLocalAccountPolicyBroker::DeviceLocalAccountPolicyBroker(
118 const DeviceLocalAccount& account, 118 const DeviceLocalAccount& account,
119 const base::FilePath& component_policy_cache_path, 119 const base::FilePath& component_policy_cache_path,
120 scoped_ptr<DeviceLocalAccountPolicyStore> store, 120 scoped_ptr<DeviceLocalAccountPolicyStore> store,
121 scoped_refptr<DeviceLocalAccountExternalDataManager> external_data_manager, 121 scoped_refptr<DeviceLocalAccountExternalDataManager> external_data_manager,
122 const base::Closure& policy_update_callback, 122 const base::Closure& policy_update_callback,
123 const scoped_refptr<base::SequencedTaskRunner>& task_runner) 123 const scoped_refptr<base::SequencedTaskRunner>& task_runner)
124 : account_id_(account.account_id), 124 : account_id_(account.account_id),
125 user_id_(account.user_id), 125 user_id_(account.user_id),
126 component_policy_cache_path_(component_policy_cache_path), 126 component_policy_cache_path_(component_policy_cache_path),
127 extension_tracker_(account, store.get(), &schema_registry_),
127 store_(store.Pass()), 128 store_(store.Pass()),
128 external_data_manager_(external_data_manager), 129 external_data_manager_(external_data_manager),
129 core_(PolicyNamespaceKey(dm_protocol::kChromePublicAccountPolicyType, 130 core_(PolicyNamespaceKey(dm_protocol::kChromePublicAccountPolicyType,
130 store_->account_id()), 131 store_->account_id()),
131 store_.get(), 132 store_.get(),
132 task_runner), 133 task_runner),
133 policy_update_callback_(policy_update_callback) { 134 policy_update_callback_(policy_update_callback) {
134 base::FilePath cache_root_dir; 135 base::FilePath cache_root_dir;
135 CHECK(PathService::Get(chromeos::DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS, 136 CHECK(PathService::Get(chromeos::DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS,
136 &cache_root_dir)); 137 &cache_root_dir));
(...skipping 19 matching lines...) Expand all
156 DeviceManagementService* device_management_service, 157 DeviceManagementService* device_management_service,
157 scoped_refptr<net::URLRequestContextGetter> request_context) { 158 scoped_refptr<net::URLRequestContextGetter> request_context) {
158 if (core_.client()) 159 if (core_.client())
159 return; 160 return;
160 161
161 scoped_ptr<CloudPolicyClient> client(CreateClient(device_settings_service, 162 scoped_ptr<CloudPolicyClient> client(CreateClient(device_settings_service,
162 device_management_service, 163 device_management_service,
163 request_context)); 164 request_context));
164 if (!client) 165 if (!client)
165 return; 166 return;
167 LOG(ERROR) << "--- connecting broker for " << user_id_;
bartfab (slow) 2014/06/20 17:03:46 Nit: Remove.
Joao da Silva 2014/06/20 22:28:19 Done ._.
166 168
167 core_.Connect(client.Pass()); 169 core_.Connect(client.Pass());
168 external_data_manager_->Connect(request_context); 170 external_data_manager_->Connect(request_context);
169 core_.StartRefreshScheduler(); 171 core_.StartRefreshScheduler();
170 UpdateRefreshDelay(); 172 UpdateRefreshDelay();
171 CreateComponentCloudPolicyService(request_context); 173 CreateComponentCloudPolicyService(request_context);
172 } 174 }
173 175
174 void DeviceLocalAccountPolicyBroker::UpdateRefreshDelay() { 176 void DeviceLocalAccountPolicyBroker::UpdateRefreshDelay() {
175 if (core_.refresh_scheduler()) { 177 if (core_.refresh_scheduler()) {
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 551 }
550 return NULL; 552 return NULL;
551 } 553 }
552 554
553 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( 555 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated(
554 const std::string& user_id) { 556 const std::string& user_id) {
555 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id)); 557 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id));
556 } 558 }
557 559
558 } // namespace policy 560 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698