| OLD | NEW |
| 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_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 private: | 134 private: |
| 135 friend class ExtensionUpdaterTest; | 135 friend class ExtensionUpdaterTest; |
| 136 friend class ExtensionUpdaterFileHandler; | 136 friend class ExtensionUpdaterFileHandler; |
| 137 | 137 |
| 138 // FetchedCRXFile holds information about a CRX file we fetched to disk, | 138 // FetchedCRXFile holds information about a CRX file we fetched to disk, |
| 139 // but have not yet installed. | 139 // but have not yet installed. |
| 140 struct FetchedCRXFile { | 140 struct FetchedCRXFile { |
| 141 FetchedCRXFile(); | 141 FetchedCRXFile(); |
| 142 FetchedCRXFile(const std::string& id, | 142 FetchedCRXFile(const std::string& id, |
| 143 const base::FilePath& path, | 143 const base::FilePath& path, |
| 144 const std::string& hash, |
| 144 bool file_ownership_passed, | 145 bool file_ownership_passed, |
| 145 const std::set<int>& request_ids); | 146 const std::set<int>& request_ids); |
| 146 ~FetchedCRXFile(); | 147 ~FetchedCRXFile(); |
| 147 | 148 |
| 148 std::string extension_id; | 149 std::string extension_id; |
| 149 base::FilePath path; | 150 base::FilePath path; |
| 151 std::string hash; |
| 150 bool file_ownership_passed; | 152 bool file_ownership_passed; |
| 151 std::set<int> request_ids; | 153 std::set<int> request_ids; |
| 152 }; | 154 }; |
| 153 | 155 |
| 154 struct InProgressCheck { | 156 struct InProgressCheck { |
| 155 InProgressCheck(); | 157 InProgressCheck(); |
| 156 ~InProgressCheck(); | 158 ~InProgressCheck(); |
| 157 | 159 |
| 158 bool install_immediately; | 160 bool install_immediately; |
| 159 FinishedCallback callback; | 161 FinishedCallback callback; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // Posted by CheckSoon(). | 195 // Posted by CheckSoon(). |
| 194 void DoCheckSoon(); | 196 void DoCheckSoon(); |
| 195 | 197 |
| 196 // Implementation of ExtensionDownloaderDelegate. | 198 // Implementation of ExtensionDownloaderDelegate. |
| 197 void OnExtensionDownloadFailed(const std::string& id, | 199 void OnExtensionDownloadFailed(const std::string& id, |
| 198 Error error, | 200 Error error, |
| 199 const PingResult& ping, | 201 const PingResult& ping, |
| 200 const std::set<int>& request_ids) override; | 202 const std::set<int>& request_ids) override; |
| 201 void OnExtensionDownloadFinished(const std::string& id, | 203 void OnExtensionDownloadFinished(const std::string& id, |
| 202 const base::FilePath& path, | 204 const base::FilePath& path, |
| 205 const std::string& hash, |
| 203 bool file_ownership_passed, | 206 bool file_ownership_passed, |
| 204 const GURL& download_url, | 207 const GURL& download_url, |
| 205 const std::string& version, | 208 const std::string& version, |
| 206 const PingResult& ping, | 209 const PingResult& ping, |
| 207 const std::set<int>& request_id) override; | 210 const std::set<int>& request_id) override; |
| 208 bool GetPingDataForExtension(const std::string& id, | 211 bool GetPingDataForExtension(const std::string& id, |
| 209 ManifestFetchData::PingData* ping_data) override; | 212 ManifestFetchData::PingData* ping_data) override; |
| 210 std::string GetUpdateUrlData(const std::string& id) override; | 213 std::string GetUpdateUrlData(const std::string& id) override; |
| 211 bool IsExtensionPending(const std::string& id) override; | 214 bool IsExtensionPending(const std::string& id) override; |
| 212 bool GetExtensionExistingVersion(const std::string& id, | 215 bool GetExtensionExistingVersion(const std::string& id, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 std::set<std::string> forced_updates_; | 294 std::set<std::string> forced_updates_; |
| 292 | 295 |
| 293 base::WeakPtrFactory<ExtensionUpdater> weak_ptr_factory_; | 296 base::WeakPtrFactory<ExtensionUpdater> weak_ptr_factory_; |
| 294 | 297 |
| 295 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); | 298 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); |
| 296 }; | 299 }; |
| 297 | 300 |
| 298 } // namespace extensions | 301 } // namespace extensions |
| 299 | 302 |
| 300 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ | 303 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ |
| OLD | NEW |