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

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

Issue 19733003: Implement cloud policy invalidations using the invalidation service framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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 "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.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/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h" 12 #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
13 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 13 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h"
14 #include "chrome/browser/chromeos/profiles/profile_helper.h" 14 #include "chrome/browser/chromeos/profiles/profile_helper.h"
15 #include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h" 15 #include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
16 #include "chrome/browser/policy/cloud/resource_cache.h" 16 #include "chrome/browser/policy/cloud/resource_cache.h"
17 #include "chrome/browser/policy/policy_bundle.h" 17 #include "chrome/browser/policy/policy_bundle.h"
18 #include "chrome/browser/policy/policy_domain_descriptor.h" 18 #include "chrome/browser/policy/policy_domain_descriptor.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "net/url_request/url_request_context_getter.h" 20 #include "net/url_request/url_request_context_getter.h"
21 21
22 namespace em = enterprise_management; 22 namespace em = enterprise_management;
23 23
24 namespace policy { 24 namespace policy {
25 25
26 UserCloudPolicyManagerChromeOS::UserCloudPolicyManagerChromeOS( 26 UserCloudPolicyManagerChromeOS::UserCloudPolicyManagerChromeOS(
27 scoped_ptr<CloudPolicyStore> store, 27 scoped_ptr<CloudPolicyStore> store,
28 scoped_ptr<ResourceCache> resource_cache, 28 scoped_ptr<ResourceCache> resource_cache,
29 bool wait_for_policy_fetch) 29 bool wait_for_policy_fetch,
30 invalidation::InvalidationService* invalidation_service)
30 : CloudPolicyManager( 31 : CloudPolicyManager(
31 PolicyNamespaceKey(dm_protocol::kChromeUserPolicyType, std::string()), 32 PolicyNamespaceKey(dm_protocol::kChromeUserPolicyType, std::string()),
32 store.get()), 33 store.get()),
33 store_(store.Pass()), 34 store_(store.Pass()),
34 wait_for_policy_fetch_(wait_for_policy_fetch) { 35 wait_for_policy_fetch_(wait_for_policy_fetch),
36 invalidation_service_(invalidation_service) {
35 if (resource_cache) { 37 if (resource_cache) {
36 component_policy_service_.reset(new ComponentCloudPolicyService( 38 component_policy_service_.reset(new ComponentCloudPolicyService(
37 this, store_.get(), resource_cache.Pass())); 39 this, store_.get(), resource_cache.Pass()));
38 } 40 }
39 } 41 }
40 42
41 UserCloudPolicyManagerChromeOS::~UserCloudPolicyManagerChromeOS() {} 43 UserCloudPolicyManagerChromeOS::~UserCloudPolicyManagerChromeOS() {}
42 44
43 void UserCloudPolicyManagerChromeOS::Connect( 45 void UserCloudPolicyManagerChromeOS::Connect(
44 PrefService* local_state, 46 PrefService* local_state,
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (component_policy_service_ && 268 if (component_policy_service_ &&
267 !component_policy_service_->is_initialized()) { 269 !component_policy_service_->is_initialized()) {
268 // If the client doesn't have the list of components to fetch yet then don't 270 // If the client doesn't have the list of components to fetch yet then don't
269 // start the scheduler. The |component_policy_service_| will call back into 271 // start the scheduler. The |component_policy_service_| will call back into
270 // OnComponentCloudPolicyUpdated() once it's ready. 272 // OnComponentCloudPolicyUpdated() once it's ready.
271 return; 273 return;
272 } 274 }
273 275
274 core()->StartRefreshScheduler(); 276 core()->StartRefreshScheduler();
275 core()->TrackRefreshDelayPref(local_state_, prefs::kUserPolicyRefreshRate); 277 core()->TrackRefreshDelayPref(local_state_, prefs::kUserPolicyRefreshRate);
278 CreateInvalidator(invalidation_service_);
276 } 279 }
277 280
278 } // namespace policy 281 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698