| Index: chrome/browser/policy/user_cloud_policy_store.cc
|
| diff --git a/chrome/browser/policy/user_cloud_policy_store.cc b/chrome/browser/policy/user_cloud_policy_store.cc
|
| index b47ea9005d8b6b82b3dd25f42022f12a23c8eec0..0ab54774d07554dce2ae9746f5c96467f3946885 100644
|
| --- a/chrome/browser/policy/user_cloud_policy_store.cc
|
| +++ b/chrome/browser/policy/user_cloud_policy_store.cc
|
| @@ -97,7 +97,14 @@ UserCloudPolicyStore::UserCloudPolicyStore(Profile* profile,
|
| backing_file_path_(path) {
|
| }
|
|
|
| -UserCloudPolicyStore::~UserCloudPolicyStore() {
|
| +UserCloudPolicyStore::~UserCloudPolicyStore() {}
|
| +
|
| +// static
|
| +scoped_ptr<UserCloudPolicyStore> UserCloudPolicyStore::Create(
|
| + Profile* profile) {
|
| + FilePath path =
|
| + profile->GetPath().Append(kPolicyDir).Append(kPolicyCacheFile);
|
| + return make_scoped_ptr(new UserCloudPolicyStore(profile, path));
|
| }
|
|
|
| void UserCloudPolicyStore::LoadImmediately() {
|
| @@ -110,6 +117,17 @@ void UserCloudPolicyStore::LoadImmediately() {
|
| PolicyLoaded(false, result);
|
| }
|
|
|
| +void UserCloudPolicyStore::Clear() {
|
| + content::BrowserThread::PostTask(
|
| + content::BrowserThread::FILE, FROM_HERE,
|
| + base::Bind(base::IgnoreResult(&file_util::Delete),
|
| + backing_file_path_,
|
| + false));
|
| + policy_.reset();
|
| + policy_map_.Clear();
|
| + NotifyStoreLoaded();
|
| +}
|
| +
|
| void UserCloudPolicyStore::Load() {
|
| DVLOG(1) << "Initiating policy load from disk";
|
| // Cancel any pending Load/Store/Validate operations.
|
| @@ -173,14 +191,6 @@ void UserCloudPolicyStore::InstallLoadedPolicyAfterValidation(
|
| NotifyStoreLoaded();
|
| }
|
|
|
| -void UserCloudPolicyStore::RemoveStoredPolicy() {
|
| - content::BrowserThread::PostTask(
|
| - content::BrowserThread::FILE, FROM_HERE,
|
| - base::Bind(base::IgnoreResult(&file_util::Delete),
|
| - backing_file_path_,
|
| - false));
|
| -}
|
| -
|
| void UserCloudPolicyStore::Store(const em::PolicyFetchResponse& policy) {
|
| // Stop any pending requests to store policy, then validate the new policy
|
| // before storing it.
|
| @@ -239,16 +249,4 @@ void UserCloudPolicyStore::StorePolicyAfterValidation(
|
| NotifyStoreLoaded();
|
| }
|
|
|
| -// static
|
| -scoped_ptr<CloudPolicyStore> CloudPolicyStore::CreateUserPolicyStore(
|
| - Profile* profile,
|
| - bool force_immediate_policy_load) {
|
| - FilePath path =
|
| - profile->GetPath().Append(kPolicyDir).Append(kPolicyCacheFile);
|
| - UserCloudPolicyStore* store = new UserCloudPolicyStore(profile, path);
|
| - if (force_immediate_policy_load)
|
| - store->LoadImmediately();
|
| - return scoped_ptr<CloudPolicyStore>(store);
|
| -}
|
| -
|
| } // namespace policy
|
|
|