OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_OFFLINE_PAGES_CORE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_CORE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Returns all UI items. The list contains references to items in the cache | 88 // Returns all UI items. The list contains references to items in the cache |
89 // and has to be used synchronously. | 89 // and has to be used synchronously. |
90 std::vector<const DownloadUIItem*> GetAllItems() const; | 90 std::vector<const DownloadUIItem*> GetAllItems() const; |
91 // May return nullptr if item with specified guid does not exist. | 91 // May return nullptr if item with specified guid does not exist. |
92 const DownloadUIItem* GetItem(const std::string& guid) const; | 92 const DownloadUIItem* GetItem(const std::string& guid) const; |
93 | 93 |
94 // Commands from UI. Start async operations, result is observable | 94 // Commands from UI. Start async operations, result is observable |
95 // via Observer or directly by the user (as in 'open'). | 95 // via Observer or directly by the user (as in 'open'). |
96 void DeleteItem(const std::string& guid); | 96 void DeleteItem(const std::string& guid); |
97 int64_t GetOfflineIdByGuid(const std::string& guid) const; | 97 int64_t GetOfflineIdByGuid(const std::string& guid) const; |
| 98 void UpdateProgress(int64_t offline_id, int64_t bytes); |
98 | 99 |
99 // OfflinePageModel::Observer | 100 // OfflinePageModel::Observer |
100 void OfflinePageModelLoaded(OfflinePageModel* model) override; | 101 void OfflinePageModelLoaded(OfflinePageModel* model) override; |
101 void OfflinePageAdded(OfflinePageModel* model, | 102 void OfflinePageAdded(OfflinePageModel* model, |
102 const OfflinePageItem& added_page) override; | 103 const OfflinePageItem& added_page) override; |
103 void OfflinePageDeleted(int64_t offline_id, | 104 void OfflinePageDeleted(int64_t offline_id, |
104 const ClientId& client_id) override; | 105 const ClientId& client_id) override; |
105 | 106 |
106 // RequestCoordinator::Observer | 107 // RequestCoordinator::Observer |
107 void OnAdded(const SavePageRequest& request) override; | 108 void OnAdded(const SavePageRequest& request) override; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int observers_count_; | 180 int observers_count_; |
180 | 181 |
181 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_; | 182 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_; |
182 | 183 |
183 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter); | 184 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter); |
184 }; | 185 }; |
185 | 186 |
186 } // namespace offline_pages | 187 } // namespace offline_pages |
187 | 188 |
188 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ | 189 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ |
OLD | NEW |