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

Side by Side Diff: chrome/browser/policy/cloud/user_cloud_policy_manager.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, 4 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/policy/cloud/user_cloud_policy_manager.h" 5 #include "chrome/browser/policy/cloud/user_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 "chrome/browser/policy/cloud/cloud_policy_constants.h" 9 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
10 #include "chrome/browser/policy/cloud/cloud_policy_service.h" 10 #include "chrome/browser/policy/cloud/cloud_policy_service.h"
(...skipping 17 matching lines...) Expand all
28 UserCloudPolicyManagerFactory::GetInstance()->Register(profile_, this); 28 UserCloudPolicyManagerFactory::GetInstance()->Register(profile_, this);
29 } 29 }
30 30
31 UserCloudPolicyManager::~UserCloudPolicyManager() { 31 UserCloudPolicyManager::~UserCloudPolicyManager() {
32 UserCloudPolicyManagerFactory::GetInstance()->Unregister(profile_, this); 32 UserCloudPolicyManagerFactory::GetInstance()->Unregister(profile_, this);
33 } 33 }
34 34
35 void UserCloudPolicyManager::Connect( 35 void UserCloudPolicyManager::Connect(
36 PrefService* local_state, scoped_ptr<CloudPolicyClient> client) { 36 PrefService* local_state, scoped_ptr<CloudPolicyClient> client) {
37 core()->Connect(client.Pass()); 37 core()->Connect(client.Pass());
38 core()->StartRefreshScheduler(); 38 StartRefreshScheduler();
39 core()->TrackRefreshDelayPref(local_state, prefs::kUserPolicyRefreshRate); 39 core()->TrackRefreshDelayPref(local_state, prefs::kUserPolicyRefreshRate);
40 } 40 }
41 41
42 // static 42 // static
43 scoped_ptr<CloudPolicyClient> 43 scoped_ptr<CloudPolicyClient>
44 UserCloudPolicyManager::CreateCloudPolicyClient( 44 UserCloudPolicyManager::CreateCloudPolicyClient(
45 DeviceManagementService* device_management_service) { 45 DeviceManagementService* device_management_service) {
46 return make_scoped_ptr( 46 return make_scoped_ptr(
47 new CloudPolicyClient(std::string(), std::string(), 47 new CloudPolicyClient(std::string(), std::string(),
48 USER_AFFILIATION_NONE, 48 USER_AFFILIATION_NONE,
49 NULL, device_management_service)).Pass(); 49 NULL, device_management_service)).Pass();
50 } 50 }
51 51
52 void UserCloudPolicyManager::DisconnectAndRemovePolicy() { 52 void UserCloudPolicyManager::DisconnectAndRemovePolicy() {
53 core()->Disconnect(); 53 core()->Disconnect();
54 store_->Clear(); 54 store_->Clear();
55 } 55 }
56 56
57 bool UserCloudPolicyManager::IsClientRegistered() const { 57 bool UserCloudPolicyManager::IsClientRegistered() const {
58 return client() && client()->is_registered(); 58 return client() && client()->is_registered();
59 } 59 }
60 60
61 } // namespace policy 61 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698