Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: chrome/browser/component_updater/component_updater_service.h

Issue 209313002: Modified components ui to address concern of all the time disabled check update button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modifications to expose CrxUpdateItem to ComponentsUI as per discussion. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 std::vector<uint8> pk_hash; 71 std::vector<uint8> pk_hash;
72 ComponentInstaller* installer; 72 ComponentInstaller* installer;
73 Version version; 73 Version version;
74 std::string fingerprint; 74 std::string fingerprint;
75 std::string name; 75 std::string name;
76 bool allow_background_download; 76 bool allow_background_download;
77 CrxComponent(); 77 CrxComponent();
78 ~CrxComponent(); 78 ~CrxComponent();
79 }; 79 };
80 80
81 // Convenience structure to use with component listing / enumeration. 81 struct CrxUpdateItem;
82 struct CrxComponentInfo {
83 // |id| is currently derived from |CrxComponent.pk_hash|, see rest of the
84 // class implementation for details.
85 std::string id;
86 std::string version;
87 std::string name;
88 CrxComponentInfo();
89 ~CrxComponentInfo();
90 };
91 82
92 // The component update service is in charge of installing or upgrading 83 // The component update service is in charge of installing or upgrading
93 // select parts of chrome. Each part is called a component and managed by 84 // select parts of chrome. Each part is called a component and managed by
94 // instances of CrxComponent registered using RegisterComponent(). On the 85 // instances of CrxComponent registered using RegisterComponent(). On the
95 // server, each component is packaged as a CRX which is the same format used 86 // server, each component is packaged as a CRX which is the same format used
96 // to package extensions. To the update service each component is identified 87 // to package extensions. To the update service each component is identified
97 // by its public key hash (CrxComponent::pk_hash). If there is an update 88 // by its public key hash (CrxComponent::pk_hash). If there is an update
98 // available and its version is bigger than (CrxComponent::version), it will 89 // available and its version is bigger than (CrxComponent::version), it will
99 // be downloaded, verified and unpacked. Then component-specific installer 90 // be downloaded, verified and unpacked. Then component-specific installer
100 // ComponentInstaller::Install (of CrxComponent::installer) will be called. 91 // ComponentInstaller::Install (of CrxComponent::installer) will be called.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 195
205 // Stop doing update checks. In-flight requests and pending installations 196 // Stop doing update checks. In-flight requests and pending installations
206 // will not be canceled. 197 // will not be canceled.
207 virtual Status Stop() = 0; 198 virtual Status Stop() = 0;
208 199
209 // Add component to be checked for updates. You can call this method 200 // Add component to be checked for updates. You can call this method
210 // before calling Start(). 201 // before calling Start().
211 virtual Status RegisterComponent(const CrxComponent& component) = 0; 202 virtual Status RegisterComponent(const CrxComponent& component) = 0;
212 203
213 // Returns a list of registered components. 204 // Returns a list of registered components.
214 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; 205 virtual void GetComponentIDs(std::vector<std::string>* component_ids) = 0;
Sorin Jianu 2014/05/03 01:09:06 Of course these two members would have to be decla
Sorin Jianu 2014/05/03 01:09:06 I would do this: virtual std::vector<std::string>
Shrikant Kelkar 2014/05/05 23:05:18 Done.
Shrikant Kelkar 2014/05/05 23:05:18 Done.
206
207 // Returns details about registered component.
208 virtual void GetComponentDetails(const std::string& component_id,
209 CrxUpdateItem** item) = 0;
215 210
216 // Returns a network resource throttle. It means that a component will be 211 // Returns a network resource throttle. It means that a component will be
217 // downloaded and installed before the resource is unthrottled. This is the 212 // downloaded and installed before the resource is unthrottled. This is the
218 // only function callable from the IO thread. 213 // only function callable from the IO thread.
219 virtual content::ResourceThrottle* GetOnDemandResourceThrottle( 214 virtual content::ResourceThrottle* GetOnDemandResourceThrottle(
220 net::URLRequest* request, const std::string& crx_id) = 0; 215 net::URLRequest* request, const std::string& crx_id) = 0;
221 216
222 virtual ~ComponentUpdateService() {} 217 virtual ~ComponentUpdateService() {}
223 218
224 friend class ::ComponentsUI; 219 friend class ::ComponentsUI;
225 friend class OnDemandTester; 220 friend class OnDemandTester;
226 221
227 private: 222 private:
228 // Ask the component updater to do an update check for a previously 223 // Ask the component updater to do an update check for a previously
229 // registered component, immediately. If an update or check is already 224 // registered component, immediately. If an update or check is already
230 // in progress, returns |kInProgress|. 225 // in progress, returns |kInProgress|.
231 // There is no guarantee that the item will actually be updated, 226 // There is no guarantee that the item will actually be updated,
232 // since an update may not be available. Listeners for the component will 227 // since an update may not be available. Listeners for the component will
233 // know the outcome of the check. 228 // know the outcome of the check.
234 virtual Status OnDemandUpdate(const std::string& component_id) = 0; 229 virtual Status OnDemandUpdate(const std::string& component_id) = 0;
235 }; 230 };
236 231
237 typedef ComponentUpdateService::Observer ServiceObserver; 232 typedef ComponentUpdateService::Observer ServiceObserver;
238 233
239 // Creates the component updater. You must pass a valid |config| allocated on 234 // Creates the component updater. You must pass a valid |config| allocated on
240 // the heap which the component updater will own. 235 // the heap which the component updater will own.
241 ComponentUpdateService* ComponentUpdateServiceFactory( 236 ComponentUpdateService* ComponentUpdateServiceFactory(
242 ComponentUpdateService::Configurator* config); 237 ComponentUpdateService::Configurator* config);
243
244 } // namespace component_updater 238 } // namespace component_updater
245 239
246 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 240 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698