| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ |
| 6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class UpdateChecker { | 26 class UpdateChecker { |
| 27 public: | 27 public: |
| 28 using UpdateCheckCallback = | 28 using UpdateCheckCallback = |
| 29 base::Callback<void(int error, | 29 base::Callback<void(int error, |
| 30 const UpdateResponse::Results& results, | 30 const UpdateResponse::Results& results, |
| 31 int retry_after_sec)>; | 31 int retry_after_sec)>; |
| 32 | 32 |
| 33 using Factory = | 33 using Factory = |
| 34 scoped_ptr<UpdateChecker> (*)(const scoped_refptr<Configurator>& config, | 34 scoped_ptr<UpdateChecker> (*)(const scoped_refptr<Configurator>& config, |
| 35 const PersistedData& persistent); | 35 PersistedData* persistent); |
| 36 | 36 |
| 37 virtual ~UpdateChecker() {} | 37 virtual ~UpdateChecker() {} |
| 38 | 38 |
| 39 // Initiates an update check for the |items_to_check|. |additional_attributes| | 39 // Initiates an update check for the |items_to_check|. |additional_attributes| |
| 40 // provides a way to customize the <request> element. This value is inserted | 40 // provides a way to customize the <request> element. This value is inserted |
| 41 // as-is, therefore it must be well-formed as an XML attribute string. | 41 // as-is, therefore it must be well-formed as an XML attribute string. |
| 42 virtual bool CheckForUpdates( | 42 virtual bool CheckForUpdates( |
| 43 const std::vector<CrxUpdateItem*>& items_to_check, | 43 const std::vector<CrxUpdateItem*>& items_to_check, |
| 44 const std::string& additional_attributes, | 44 const std::string& additional_attributes, |
| 45 const UpdateCheckCallback& update_check_callback) = 0; | 45 const UpdateCheckCallback& update_check_callback) = 0; |
| 46 | 46 |
| 47 static scoped_ptr<UpdateChecker> Create( | 47 static scoped_ptr<UpdateChecker> Create( |
| 48 const scoped_refptr<Configurator>& config, | 48 const scoped_refptr<Configurator>& config, |
| 49 const PersistedData& persistent); | 49 PersistedData* persistent); |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 UpdateChecker() {} | 52 UpdateChecker() {} |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(UpdateChecker); | 55 DISALLOW_COPY_AND_ASSIGN(UpdateChecker); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace update_client | 58 } // namespace update_client |
| 59 | 59 |
| 60 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ | 60 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CHECKER_H_ |
| OLD | NEW |