OLD | NEW |
---|---|
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 Loading... | |
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 StartRefreshScheduler(); | 38 core()->StartRefreshScheduler(); |
39 core()->TrackRefreshDelayPref(local_state, prefs::kUserPolicyRefreshRate); | 39 core()->TrackRefreshDelayPref(local_state, prefs::kUserPolicyRefreshRate); |
40 StartInvalidator(); | |
Mattias Nissler (ping if slow)
2013/08/29 16:02:30
So the signal the invalidator apparently needs to
Steve Condie
2013/08/30 00:16:35
Yes, these signals are now published by the CloudP
| |
40 } | 41 } |
41 | 42 |
42 // static | 43 // static |
43 scoped_ptr<CloudPolicyClient> | 44 scoped_ptr<CloudPolicyClient> |
44 UserCloudPolicyManager::CreateCloudPolicyClient( | 45 UserCloudPolicyManager::CreateCloudPolicyClient( |
45 DeviceManagementService* device_management_service) { | 46 DeviceManagementService* device_management_service) { |
46 return make_scoped_ptr( | 47 return make_scoped_ptr( |
47 new CloudPolicyClient(std::string(), std::string(), | 48 new CloudPolicyClient(std::string(), std::string(), |
48 USER_AFFILIATION_NONE, | 49 USER_AFFILIATION_NONE, |
49 NULL, device_management_service)).Pass(); | 50 NULL, device_management_service)).Pass(); |
50 } | 51 } |
51 | 52 |
52 void UserCloudPolicyManager::DisconnectAndRemovePolicy() { | 53 void UserCloudPolicyManager::DisconnectAndRemovePolicy() { |
54 StopInvalidator(); | |
53 core()->Disconnect(); | 55 core()->Disconnect(); |
54 store_->Clear(); | 56 store_->Clear(); |
55 } | 57 } |
56 | 58 |
57 bool UserCloudPolicyManager::IsClientRegistered() const { | 59 bool UserCloudPolicyManager::IsClientRegistered() const { |
58 return client() && client()->is_registered(); | 60 return client() && client()->is_registered(); |
59 } | 61 } |
60 | 62 |
61 } // namespace policy | 63 } // namespace policy |
OLD | NEW |