1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_UPDATE_CHECKER_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_UPDATE_CHECKER_H_
11 #include "base/basictypes.h"
12 #include "base/callback.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/component_updater/update_response.h"
19 class URLRequestContextGetter
;
22 namespace component_updater
{
28 typedef base::Callback
<void (int error
, const std::string
& error_message
,
29 const UpdateResponse::Results
& results
)> UpdateCheckCallback
;
31 virtual ~UpdateChecker() {}
33 // Initiates an update check for the |items_to_check|. |additional_attributes|
34 // provides a way to customize the <request> element. This value is inserted
35 // as-is, therefore it must be well-formed as an XML attribute string.
36 virtual bool CheckForUpdates(
37 const std::vector
<CrxUpdateItem
*>& items_to_check
,
38 const std::string
& additional_attributes
) = 0;
40 static scoped_ptr
<UpdateChecker
> Create(
42 net::URLRequestContextGetter
* url_request_context_getter
,
43 const UpdateCheckCallback
& update_check_callback
);
49 DISALLOW_COPY_AND_ASSIGN(UpdateChecker
);
52 } // namespace component_updater
54 #endif // CHROME_BROWSER_COMPONENT_UPDATER_UPDATE_CHECKER_H_