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

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: Code review changes. Created 6 years, 9 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 ComponentInstaller* installer; 106 ComponentInstaller* installer;
107 ComponentObserver* observer; 107 ComponentObserver* observer;
108 Version version; 108 Version version;
109 std::string fingerprint; 109 std::string fingerprint;
110 std::string name; 110 std::string name;
111 bool allow_background_download; 111 bool allow_background_download;
112 CrxComponent(); 112 CrxComponent();
113 ~CrxComponent(); 113 ~CrxComponent();
114 }; 114 };
115 115
116 // Convenience structure to use with component listing / enumeration. 116 struct CrxComponentInfo;
117 struct CrxComponentInfo {
118 // |id| is currently derived from |CrxComponent.pk_hash|, see rest of the
119 // class implementation for details.
120 std::string id;
121 std::string version;
122 std::string name;
123 CrxComponentInfo();
124 ~CrxComponentInfo();
125 };
126 117
127 // The component update service is in charge of installing or upgrading 118 // The component update service is in charge of installing or upgrading
128 // select parts of chrome. Each part is called a component and managed by 119 // select parts of chrome. Each part is called a component and managed by
129 // instances of CrxComponent registered using RegisterComponent(). On the 120 // instances of CrxComponent registered using RegisterComponent(). On the
130 // server, each component is packaged as a CRX which is the same format used 121 // server, each component is packaged as a CRX which is the same format used
131 // to package extensions. To the update service each component is identified 122 // to package extensions. To the update service each component is identified
132 // by its public key hash (CrxComponent::pk_hash). If there is an update 123 // by its public key hash (CrxComponent::pk_hash). If there is an update
133 // available and its version is bigger than (CrxComponent::version), it will 124 // available and its version is bigger than (CrxComponent::version), it will
134 // be downloaded, verified and unpacked. Then component-specific installer 125 // be downloaded, verified and unpacked. Then component-specific installer
135 // ComponentInstaller::Install (of CrxComponent::installer) will be called. 126 // ComponentInstaller::Install (of CrxComponent::installer) will be called.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // will not be canceled. 187 // will not be canceled.
197 virtual Status Stop() = 0; 188 virtual Status Stop() = 0;
198 189
199 // Add component to be checked for updates. You can call this method 190 // Add component to be checked for updates. You can call this method
200 // before calling Start(). 191 // before calling Start().
201 virtual Status RegisterComponent(const CrxComponent& component) = 0; 192 virtual Status RegisterComponent(const CrxComponent& component) = 0;
202 193
203 // Returns a list of registered components. 194 // Returns a list of registered components.
204 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0; 195 virtual void GetComponents(std::vector<CrxComponentInfo>* components) = 0;
205 196
197 // Returns current status of a previously registered component.
198 virtual Status GetComponentStatus(const std::string& component_id) = 0;
199
206 // Returns a network resource throttle. It means that a component will be 200 // Returns a network resource throttle. It means that a component will be
207 // downloaded and installed before the resource is unthrottled. This is the 201 // downloaded and installed before the resource is unthrottled. This is the
208 // only function callable from the IO thread. 202 // only function callable from the IO thread.
209 virtual content::ResourceThrottle* GetOnDemandResourceThrottle( 203 virtual content::ResourceThrottle* GetOnDemandResourceThrottle(
210 net::URLRequest* request, const std::string& crx_id) = 0; 204 net::URLRequest* request, const std::string& crx_id) = 0;
211 205
212 virtual ~ComponentUpdateService() {} 206 virtual ~ComponentUpdateService() {}
213 207
214 friend class ::ComponentsUI; 208 friend class ::ComponentsUI;
215 friend class OnDemandTester; 209 friend class OnDemandTester;
216 210
217 private: 211 private:
218 // Ask the component updater to do an update check for a previously 212 // Ask the component updater to do an update check for a previously
219 // registered component, immediately. If an update or check is already 213 // registered component, immediately. If an update or check is already
220 // in progress, returns |kInProgress|. 214 // in progress, returns |kInProgress|.
221 // There is no guarantee that the item will actually be updated, 215 // There is no guarantee that the item will actually be updated,
222 // since an update may not be available. Listeners for the component will 216 // since an update may not be available. Listeners for the component will
223 // know the outcome of the check. 217 // know the outcome of the check.
224 virtual Status OnDemandUpdate(const std::string& component_id) = 0; 218 virtual Status OnDemandUpdate(const std::string& component_id) = 0;
225 }; 219 };
226 220
227 // Creates the component updater. You must pass a valid |config| allocated on 221 // Creates the component updater. You must pass a valid |config| allocated on
228 // the heap which the component updater will own. 222 // the heap which the component updater will own.
229 ComponentUpdateService* ComponentUpdateServiceFactory( 223 ComponentUpdateService* ComponentUpdateServiceFactory(
230 ComponentUpdateService::Configurator* config); 224 ComponentUpdateService::Configurator* config);
231 225
226 // Convenience structure to use with component listing / enumeration.
227 struct CrxComponentInfo {
228 // |id| is currently derived from |CrxComponent.pk_hash|, see rest of the
229 // class implementation for details.
230 std::string id;
231 std::string version;
232 std::string name;
233 ComponentUpdateService::Status status;
234 CrxComponentInfo();
235 ~CrxComponentInfo();
236 };
237
232 } // namespace component_updater 238 } // namespace component_updater
233 239
234 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 240 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/component_updater/component_updater_service.cc » ('j') | chrome/browser/resources/components.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698