Supervised user block interstitial: Fix font
[chromium-blink-merge.git] / components / component_updater / update_checker.h
blob742aed7d36df83bea301882f46e40a18a340e7f5
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_COMPONENT_UPDATER_UPDATE_CHECKER_H_
6 #define COMPONENTS_COMPONENT_UPDATER_UPDATE_CHECKER_H_
8 #include <string>
9 #include <vector>
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "components/component_updater/update_response.h"
15 #include "url/gurl.h"
17 class GURL;
19 namespace net {
20 class URLRequestContextGetter;
23 namespace component_updater {
25 class Configurator;
26 struct CrxUpdateItem;
28 class UpdateChecker {
29 public:
30 typedef base::Callback<void(const GURL& original_url,
31 int error,
32 const std::string& error_message,
33 const UpdateResponse::Results& results)>
34 UpdateCheckCallback;
36 virtual ~UpdateChecker() {}
38 // Initiates an update check for the |items_to_check|. |additional_attributes|
39 // provides a way to customize the <request> element. This value is inserted
40 // as-is, therefore it must be well-formed as an XML attribute string.
41 virtual bool CheckForUpdates(
42 const std::vector<CrxUpdateItem*>& items_to_check,
43 const std::string& additional_attributes,
44 const UpdateCheckCallback& update_check_callback) = 0;
46 static scoped_ptr<UpdateChecker> Create(const Configurator& config);
48 protected:
49 UpdateChecker() {}
51 private:
52 DISALLOW_COPY_AND_ASSIGN(UpdateChecker);
55 } // namespace component_updater
57 #endif // COMPONENTS_COMPONENT_UPDATER_UPDATE_CHECKER_H_