| 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 "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
| 10 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" | 10 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 UserCloudPolicyManagerFactory::GetInstance()->Unregister(profile_, this); | 39 UserCloudPolicyManagerFactory::GetInstance()->Unregister(profile_, this); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void UserCloudPolicyManager::Shutdown() { | 42 void UserCloudPolicyManager::Shutdown() { |
| 43 if (external_data_manager_) | 43 if (external_data_manager_) |
| 44 external_data_manager_->Disconnect(); | 44 external_data_manager_->Disconnect(); |
| 45 CloudPolicyManager::Shutdown(); | 45 CloudPolicyManager::Shutdown(); |
| 46 BrowserContextKeyedService::Shutdown(); | 46 BrowserContextKeyedService::Shutdown(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void UserCloudPolicyManager::SetSigninUsername(const std::string& username) { |
| 50 store_->SetSigninUsername(username); |
| 51 } |
| 52 |
| 49 void UserCloudPolicyManager::Connect( | 53 void UserCloudPolicyManager::Connect( |
| 50 PrefService* local_state, | 54 PrefService* local_state, |
| 51 scoped_refptr<net::URLRequestContextGetter> request_context, | 55 scoped_refptr<net::URLRequestContextGetter> request_context, |
| 52 scoped_ptr<CloudPolicyClient> client) { | 56 scoped_ptr<CloudPolicyClient> client) { |
| 53 core()->Connect(client.Pass()); | 57 core()->Connect(client.Pass()); |
| 54 core()->StartRefreshScheduler(); | 58 core()->StartRefreshScheduler(); |
| 55 core()->TrackRefreshDelayPref(local_state, | 59 core()->TrackRefreshDelayPref(local_state, |
| 56 policy_prefs::kUserPolicyRefreshRate); | 60 policy_prefs::kUserPolicyRefreshRate); |
| 57 if (external_data_manager_) | 61 if (external_data_manager_) |
| 58 external_data_manager_->Connect(request_context); | 62 external_data_manager_->Connect(request_context); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 76 // all external data references have been removed, causing the | 80 // all external data references have been removed, causing the |
| 77 // |external_data_manager_| to clear its cache as well. | 81 // |external_data_manager_| to clear its cache as well. |
| 78 store_->Clear(); | 82 store_->Clear(); |
| 79 } | 83 } |
| 80 | 84 |
| 81 bool UserCloudPolicyManager::IsClientRegistered() const { | 85 bool UserCloudPolicyManager::IsClientRegistered() const { |
| 82 return client() && client()->is_registered(); | 86 return client() && client()->is_registered(); |
| 83 } | 87 } |
| 84 | 88 |
| 85 } // namespace policy | 89 } // namespace policy |
| OLD | NEW |