| 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 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // Returns a list of registered components. | 200 // Returns a list of registered components. |
| 201 virtual std::vector<std::string> GetComponentIDs() const = 0; | 201 virtual std::vector<std::string> GetComponentIDs() const = 0; |
| 202 | 202 |
| 203 // Returns an interface for on-demand updates. On-demand updates are | 203 // Returns an interface for on-demand updates. On-demand updates are |
| 204 // proactively triggered outside the normal component update service schedule. | 204 // proactively triggered outside the normal component update service schedule. |
| 205 virtual OnDemandUpdater& GetOnDemandUpdater() = 0; | 205 virtual OnDemandUpdater& GetOnDemandUpdater() = 0; |
| 206 | 206 |
| 207 virtual ~ComponentUpdateService() {} | 207 virtual ~ComponentUpdateService() {} |
| 208 | 208 |
| 209 private: | 209 private: |
| 210 // Returns details about registered component. The object returned is owned | 210 // Returns details about registered component in the |item| parameter. The |
| 211 // by this class. TODO(sorin): replace with a WeakPtr. | 211 // function returns true in case of success and false in case of errors. |
| 212 virtual CrxUpdateItem* GetComponentDetails( | 212 virtual bool GetComponentDetails(const std::string& component_id, |
| 213 const std::string& component_id) const = 0; | 213 CrxUpdateItem* item) 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: |
| 223 virtual ~OnDemandUpdater() {} | 223 virtual ~OnDemandUpdater() {} |
| (...skipping 23 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 |