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

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

Issue 12054003: Add an API to component_updater that asks to do an update check "now". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 7 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // During the normal operation of the component updater some specific 81 // During the normal operation of the component updater some specific
82 // notifications are fired, like COMPONENT_UPDATER_STARTED and 82 // notifications are fired, like COMPONENT_UPDATER_STARTED and
83 // COMPONENT_UPDATE_FOUND. See notification_type.h for more details. 83 // COMPONENT_UPDATE_FOUND. See notification_type.h for more details.
84 // 84 //
85 // All methods are safe to call ONLY from chrome's UI thread. 85 // All methods are safe to call ONLY from chrome's UI thread.
86 class ComponentUpdateService { 86 class ComponentUpdateService {
87 public: 87 public:
88 enum Status { 88 enum Status {
89 kOk, 89 kOk,
90 kReplaced, 90 kReplaced,
91 kInProgress,
91 kError 92 kError
92 }; 93 };
93 // Controls the component updater behavior. 94 // Controls the component updater behavior.
94 class Configurator { 95 class Configurator {
95 public: 96 public:
96 enum Events { 97 enum Events {
97 kManifestCheck, 98 kManifestCheck,
98 kComponentUpdated, 99 kComponentUpdated,
99 kManifestError, 100 kManifestError,
100 kNetworkError, 101 kNetworkError,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 virtual Status Start() = 0; 133 virtual Status Start() = 0;
133 134
134 // Stop doing update checks. In-flight requests and pending installations 135 // Stop doing update checks. In-flight requests and pending installations
135 // will not be canceled. 136 // will not be canceled.
136 virtual Status Stop() = 0; 137 virtual Status Stop() = 0;
137 138
138 // Add component to be checked for updates. You can call this method 139 // Add component to be checked for updates. You can call this method
139 // before calling Start(). 140 // before calling Start().
140 virtual Status RegisterComponent(const CrxComponent& component) = 0; 141 virtual Status RegisterComponent(const CrxComponent& component) = 0;
141 142
143 // Ask the component updater to do an update check for a previously
144 // registered component, soon. Only one client may request for this
145 // higher priority treatment at one time. Returns |kInProgress| if
146 // there is already a request in progress
147 virtual Status CheckForUpdateSoon(const CrxComponent& component) = 0;
148
142 virtual ~ComponentUpdateService() {} 149 virtual ~ComponentUpdateService() {}
143 }; 150 };
144 151
145 // Creates the component updater. You must pass a valid |config| allocated on 152 // Creates the component updater. You must pass a valid |config| allocated on
146 // the heap which the component updater will own. 153 // the heap which the component updater will own.
147 ComponentUpdateService* ComponentUpdateServiceFactory( 154 ComponentUpdateService* ComponentUpdateServiceFactory(
148 ComponentUpdateService::Configurator* config); 155 ComponentUpdateService::Configurator* config);
149 156
150 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ 157 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
151
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698