| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void StopTimerForTesting(); | 132 void StopTimerForTesting(); |
| 133 | 133 |
| 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 CRXFileInfo& file, |
| 143 const base::FilePath& path, | |
| 144 bool file_ownership_passed, | 143 bool file_ownership_passed, |
| 145 const std::set<int>& request_ids); | 144 const std::set<int>& request_ids); |
| 146 ~FetchedCRXFile(); | 145 ~FetchedCRXFile(); |
| 147 | 146 |
| 148 std::string extension_id; | 147 CRXFileInfo info; |
| 149 base::FilePath path; | |
| 150 bool file_ownership_passed; | 148 bool file_ownership_passed; |
| 151 std::set<int> request_ids; | 149 std::set<int> request_ids; |
| 152 }; | 150 }; |
| 153 | 151 |
| 154 struct InProgressCheck { | 152 struct InProgressCheck { |
| 155 InProgressCheck(); | 153 InProgressCheck(); |
| 156 ~InProgressCheck(); | 154 ~InProgressCheck(); |
| 157 | 155 |
| 158 bool install_immediately; | 156 bool install_immediately; |
| 159 FinishedCallback callback; | 157 FinishedCallback callback; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void TimerFired(); | 189 void TimerFired(); |
| 192 | 190 |
| 193 // Posted by CheckSoon(). | 191 // Posted by CheckSoon(). |
| 194 void DoCheckSoon(); | 192 void DoCheckSoon(); |
| 195 | 193 |
| 196 // Implementation of ExtensionDownloaderDelegate. | 194 // Implementation of ExtensionDownloaderDelegate. |
| 197 void OnExtensionDownloadFailed(const std::string& id, | 195 void OnExtensionDownloadFailed(const std::string& id, |
| 198 Error error, | 196 Error error, |
| 199 const PingResult& ping, | 197 const PingResult& ping, |
| 200 const std::set<int>& request_ids) override; | 198 const std::set<int>& request_ids) override; |
| 201 void OnExtensionDownloadFinished(const std::string& id, | 199 void OnExtensionDownloadFinished(const CRXFileInfo& file, |
| 202 const base::FilePath& path, | |
| 203 bool file_ownership_passed, | 200 bool file_ownership_passed, |
| 204 const GURL& download_url, | 201 const GURL& download_url, |
| 205 const std::string& version, | 202 const std::string& version, |
| 206 const PingResult& ping, | 203 const PingResult& ping, |
| 207 const std::set<int>& request_id) override; | 204 const std::set<int>& request_id) override; |
| 208 bool GetPingDataForExtension(const std::string& id, | 205 bool GetPingDataForExtension(const std::string& id, |
| 209 ManifestFetchData::PingData* ping_data) override; | 206 ManifestFetchData::PingData* ping_data) override; |
| 210 std::string GetUpdateUrlData(const std::string& id) override; | 207 std::string GetUpdateUrlData(const std::string& id) override; |
| 211 bool IsExtensionPending(const std::string& id) override; | 208 bool IsExtensionPending(const std::string& id) override; |
| 212 bool GetExtensionExistingVersion(const std::string& id, | 209 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_; | 288 std::set<std::string> forced_updates_; |
| 292 | 289 |
| 293 base::WeakPtrFactory<ExtensionUpdater> weak_ptr_factory_; | 290 base::WeakPtrFactory<ExtensionUpdater> weak_ptr_factory_; |
| 294 | 291 |
| 295 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); | 292 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); |
| 296 }; | 293 }; |
| 297 | 294 |
| 298 } // namespace extensions | 295 } // namespace extensions |
| 299 | 296 |
| 300 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ | 297 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ |
| OLD | NEW |