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 COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_
6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "components/update_client/update_response.h"
20 class URLRequestContextGetter
;
23 namespace update_client
{
30 using UpdateCheckCallback
=
31 base::Callback
<void(const GURL
& original_url
,
33 const std::string
& error_message
,
34 const UpdateResponse::Results
& results
)>;
36 using Factory
= scoped_ptr
<UpdateChecker
>(*)(const Configurator
& config
);
38 virtual ~UpdateChecker() {}
40 // Initiates an update check for the |items_to_check|. |additional_attributes|
41 // provides a way to customize the <request> element. This value is inserted
42 // as-is, therefore it must be well-formed as an XML attribute string.
43 virtual bool CheckForUpdates(
44 const std::vector
<CrxUpdateItem
*>& items_to_check
,
45 const std::string
& additional_attributes
,
46 const UpdateCheckCallback
& update_check_callback
) = 0;
48 static scoped_ptr
<UpdateChecker
> Create(const Configurator
& config
);
54 DISALLOW_COPY_AND_ASSIGN(UpdateChecker
);
57 } // namespace update_client
59 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_