| 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/chromeos/policy/user_cloud_policy_store_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_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/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 const base::FilePath& token_cache_file, | 69 const base::FilePath& token_cache_file, |
| 70 const base::FilePath& policy_cache_file, | 70 const base::FilePath& policy_cache_file, |
| 71 scoped_refptr<base::SequencedTaskRunner> background_task_runner); | 71 scoped_refptr<base::SequencedTaskRunner> background_task_runner); |
| 72 virtual ~LegacyPolicyCacheLoader(); | 72 virtual ~LegacyPolicyCacheLoader(); |
| 73 | 73 |
| 74 // Starts loading, and reports the result to |callback| when done. | 74 // Starts loading, and reports the result to |callback| when done. |
| 75 void Load(const Callback& callback); | 75 void Load(const Callback& callback); |
| 76 | 76 |
| 77 // UserPolicyTokenLoader::Delegate: | 77 // UserPolicyTokenLoader::Delegate: |
| 78 virtual void OnTokenLoaded(const std::string& token, | 78 virtual void OnTokenLoaded(const std::string& token, |
| 79 const std::string& device_id) OVERRIDE; | 79 const std::string& device_id) override; |
| 80 | 80 |
| 81 // UserPolicyDiskCache::Delegate: | 81 // UserPolicyDiskCache::Delegate: |
| 82 virtual void OnDiskCacheLoaded( | 82 virtual void OnDiskCacheLoaded( |
| 83 UserPolicyDiskCache::LoadResult result, | 83 UserPolicyDiskCache::LoadResult result, |
| 84 const em::CachedCloudPolicyResponse& policy) OVERRIDE; | 84 const em::CachedCloudPolicyResponse& policy) override; |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 // Checks whether the load operations from the legacy caches completed. If so, | 87 // Checks whether the load operations from the legacy caches completed. If so, |
| 88 // fires the appropriate notification. | 88 // fires the appropriate notification. |
| 89 void CheckLoadFinished(); | 89 void CheckLoadFinished(); |
| 90 | 90 |
| 91 // Maps a disk cache LoadResult to a CloudPolicyStore::Status. | 91 // Maps a disk cache LoadResult to a CloudPolicyStore::Status. |
| 92 static CloudPolicyStore::Status TranslateLoadResult( | 92 static CloudPolicyStore::Status TranslateLoadResult( |
| 93 UserPolicyDiskCache::LoadResult result); | 93 UserPolicyDiskCache::LoadResult result); |
| 94 | 94 |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 const std::string empty_key = std::string(); | 562 const std::string empty_key = std::string(); |
| 563 // The policy loaded from session manager need not be validated using the | 563 // The policy loaded from session manager need not be validated using the |
| 564 // verification key since it is secure, and since there may be legacy policy | 564 // verification key since it is secure, and since there may be legacy policy |
| 565 // data that was stored without a verification key. Hence passing an empty | 565 // data that was stored without a verification key. Hence passing an empty |
| 566 // value for the verification key. | 566 // value for the verification key. |
| 567 validator->ValidateSignature( | 567 validator->ValidateSignature( |
| 568 policy_key_, empty_key, ExtractDomain(username_), allow_rotation); | 568 policy_key_, empty_key, ExtractDomain(username_), allow_rotation); |
| 569 return validator.Pass(); | 569 return validator.Pass(); |
| 570 } | 570 } |
| 571 } // namespace policy | 571 } // namespace policy |
| OLD | NEW |