OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/weak_ptr.h" | |
12 #include "base/version.h" | 13 #include "base/version.h" |
13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
14 | 15 |
15 class ComponentsUI; | 16 class ComponentsUI; |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class DictionaryValue; | 19 class DictionaryValue; |
19 class FilePath; | 20 class FilePath; |
20 } | 21 } |
21 | 22 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 // Returns a list of registered components. | 201 // Returns a list of registered components. |
201 virtual std::vector<std::string> GetComponentIDs() const = 0; | 202 virtual std::vector<std::string> GetComponentIDs() const = 0; |
202 | 203 |
203 // Returns an interface for on-demand updates. On-demand updates are | 204 // Returns an interface for on-demand updates. On-demand updates are |
204 // proactively triggered outside the normal component update service schedule. | 205 // proactively triggered outside the normal component update service schedule. |
205 virtual OnDemandUpdater& GetOnDemandUpdater() = 0; | 206 virtual OnDemandUpdater& GetOnDemandUpdater() = 0; |
206 | 207 |
207 virtual ~ComponentUpdateService() {} | 208 virtual ~ComponentUpdateService() {} |
208 | 209 |
209 private: | 210 private: |
210 // Returns details about registered component. The object returned is owned | 211 // Returns details about registered component. |
211 // by this class. TODO(sorin): replace with a WeakPtr. | 212 virtual base::WeakPtr<CrxUpdateItem> GetComponentDetails( |
cpu_(ooo_6.6-7.5)
2014/06/09 23:12:57
This sparked an interesting discussion among few f
| |
212 virtual CrxUpdateItem* GetComponentDetails( | |
213 const std::string& component_id) const = 0; | 213 const std::string& component_id) const = 0; |
214 | 214 |
215 friend class ::ComponentsUI; | 215 friend class ::ComponentsUI; |
216 FRIEND_TEST_ALL_PREFIXES(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate); | 216 FRIEND_TEST_ALL_PREFIXES(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate); |
217 }; | 217 }; |
218 | 218 |
219 typedef ComponentUpdateService::Observer ServiceObserver; | 219 typedef ComponentUpdateService::Observer ServiceObserver; |
220 | 220 |
221 class OnDemandUpdater { | 221 class OnDemandUpdater { |
222 public: | 222 public: |
(...skipping 24 matching lines...) Expand all Loading... | |
247 const std::string& component_id) = 0; | 247 const std::string& component_id) = 0; |
248 }; | 248 }; |
249 | 249 |
250 // Creates the component updater. You must pass a valid |config| allocated on | 250 // Creates the component updater. You must pass a valid |config| allocated on |
251 // the heap which the component updater will own. | 251 // the heap which the component updater will own. |
252 ComponentUpdateService* ComponentUpdateServiceFactory( | 252 ComponentUpdateService* ComponentUpdateServiceFactory( |
253 ComponentUpdateService::Configurator* config); | 253 ComponentUpdateService::Configurator* config); |
254 } // namespace component_updater | 254 } // namespace component_updater |
255 | 255 |
256 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 256 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |