OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 5 #ifndef COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace content { | 31 namespace content { |
32 class ResourceThrottle; | 32 class ResourceThrottle; |
33 } | 33 } |
34 | 34 |
35 namespace net { | 35 namespace net { |
36 class URLRequestContextGetter; | 36 class URLRequestContextGetter; |
37 class URLRequest; | 37 class URLRequest; |
38 } | 38 } |
39 | 39 |
| 40 namespace policy { |
| 41 class ComponentUpdaterPolicyTest; |
| 42 } |
| 43 |
40 namespace update_client { | 44 namespace update_client { |
41 class ComponentInstaller; | 45 class ComponentInstaller; |
42 class Configurator; | 46 class Configurator; |
43 struct CrxComponent; | 47 struct CrxComponent; |
44 struct CrxUpdateItem; | 48 struct CrxUpdateItem; |
45 } | 49 } |
46 | 50 |
47 namespace component_updater { | 51 namespace component_updater { |
48 | 52 |
49 class OnDemandUpdater; | 53 class OnDemandUpdater; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 }; | 152 }; |
149 | 153 |
150 using ServiceObserver = ComponentUpdateService::Observer; | 154 using ServiceObserver = ComponentUpdateService::Observer; |
151 | 155 |
152 class OnDemandUpdater { | 156 class OnDemandUpdater { |
153 public: | 157 public: |
154 virtual ~OnDemandUpdater() {} | 158 virtual ~OnDemandUpdater() {} |
155 | 159 |
156 private: | 160 private: |
157 friend class OnDemandTester; | 161 friend class OnDemandTester; |
| 162 friend class policy::ComponentUpdaterPolicyTest; |
158 friend class SupervisedUserWhitelistInstaller; | 163 friend class SupervisedUserWhitelistInstaller; |
159 friend class ::ComponentsUI; | 164 friend class ::ComponentsUI; |
160 friend class ::PluginObserver; | 165 friend class ::PluginObserver; |
161 | 166 |
162 // Triggers an update check for a component. |id| is a value | 167 // Triggers an update check for a component. |id| is a value |
163 // returned by GetCrxComponentID(). If an update for this component is already | 168 // returned by GetCrxComponentID(). If an update for this component is already |
164 // in progress, the function returns |kInProgress|. If an update is available, | 169 // in progress, the function returns |kInProgress|. If an update is available, |
165 // the update will be applied. The caller can subscribe to component update | 170 // the update will be applied. The caller can subscribe to component update |
166 // service notifications and provide an optional callback to get the result | 171 // service notifications and provide an optional callback to get the result |
167 // of the call. The function does not implement any cooldown interval. | 172 // of the call. The function does not implement any cooldown interval. |
168 virtual void OnDemandUpdate( | 173 virtual void OnDemandUpdate( |
169 const std::string& id, | 174 const std::string& id, |
170 ComponentUpdateService::CompletionCallback callback) = 0; | 175 ComponentUpdateService::CompletionCallback callback) = 0; |
171 }; | 176 }; |
172 | 177 |
173 // Creates the component updater. | 178 // Creates the component updater. |
174 std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory( | 179 std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory( |
175 const scoped_refptr<Configurator>& config); | 180 const scoped_refptr<Configurator>& config); |
176 | 181 |
177 } // namespace component_updater | 182 } // namespace component_updater |
178 | 183 |
179 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 184 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |