| 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 #ifndef CHROME_BROWSER_POLICY_ASYNC_POLICY_LOADER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_ASYNC_POLICY_LOADER_H_ |
| 6 #define CHROME_BROWSER_POLICY_ASYNC_POLICY_LOADER_H_ | 6 #define CHROME_BROWSER_POLICY_ASYNC_POLICY_LOADER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 private: | 83 private: |
| 84 // Allow AsyncPolicyProvider to call Init(). | 84 // Allow AsyncPolicyProvider to call Init(). |
| 85 friend class AsyncPolicyProvider; | 85 friend class AsyncPolicyProvider; |
| 86 | 86 |
| 87 typedef base::Callback<void(scoped_ptr<PolicyBundle>)> UpdateCallback; | 87 typedef base::Callback<void(scoped_ptr<PolicyBundle>)> UpdateCallback; |
| 88 | 88 |
| 89 // Used by the AsyncPolicyProvider to do the initial Load(). The first load | 89 // Used by the AsyncPolicyProvider to do the initial Load(). The first load |
| 90 // is also used to initialize |last_modification_time_|. | 90 // is also used to initialize |last_modification_time_|. |
| 91 scoped_ptr<PolicyBundle> InitialLoad(); | 91 scoped_ptr<PolicyBundle> InitialLoad(); |
| 92 | 92 |
| 93 // Registers a policy domain without triggering a policy load. |
| 94 void InitialRegisterPolicyDomain( |
| 95 scoped_refptr<const PolicyDomainDescriptor> descriptor); |
| 96 |
| 93 // Used by the AsyncPolicyProvider to install the |update_callback_|. | 97 // Used by the AsyncPolicyProvider to install the |update_callback_|. |
| 94 // Invoked on the background thread. | 98 // Invoked on the background thread. |
| 95 void Init(const UpdateCallback& update_callback); | 99 void Init(const UpdateCallback& update_callback); |
| 96 | 100 |
| 97 // Cancels any pending periodic reload and posts one |delay| time units from | 101 // Cancels any pending periodic reload and posts one |delay| time units from |
| 98 // now. | 102 // now. |
| 99 void ScheduleNextReload(base::TimeDelta delay); | 103 void ScheduleNextReload(base::TimeDelta delay); |
| 100 | 104 |
| 101 // Checks if the underlying files haven't changed recently, by checking the | 105 // Checks if the underlying files haven't changed recently, by checking the |
| 102 // LastModificationTime(). |delay| is updated with a suggested time to wait | 106 // LastModificationTime(). |delay| is updated with a suggested time to wait |
| (...skipping 20 matching lines...) Expand all Loading... |
| 123 | 127 |
| 124 // A map of the currently registered domains and their descriptors. | 128 // A map of the currently registered domains and their descriptors. |
| 125 DescriptorMap descriptor_map_; | 129 DescriptorMap descriptor_map_; |
| 126 | 130 |
| 127 DISALLOW_COPY_AND_ASSIGN(AsyncPolicyLoader); | 131 DISALLOW_COPY_AND_ASSIGN(AsyncPolicyLoader); |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 } // namespace policy | 134 } // namespace policy |
| 131 | 135 |
| 132 #endif // CHROME_BROWSER_POLICY_ASYNC_POLICY_LOADER_H_ | 136 #endif // CHROME_BROWSER_POLICY_ASYNC_POLICY_LOADER_H_ |
| OLD | NEW |