| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 typedef std::map<std::string, std::unique_ptr<ItemInfo>> DownloadUIItems; | 103 typedef std::map<std::string, std::unique_ptr<ItemInfo>> DownloadUIItems; |
| 104 | 104 |
| 105 void LoadCache(); | 105 void LoadCache(); |
| 106 void ClearCache(); | 106 void ClearCache(); |
| 107 | 107 |
| 108 // Task callbacks. | 108 // Task callbacks. |
| 109 void OnOfflinePagesLoaded(const MultipleOfflinePageItemResult& pages); | 109 void OnOfflinePagesLoaded(const MultipleOfflinePageItemResult& pages); |
| 110 void NotifyItemsLoaded(Observer* observer); | 110 void NotifyItemsLoaded(Observer* observer); |
| 111 void OnOfflinePagesChanged(const MultipleOfflinePageItemResult& pages); | |
| 112 void OnDeletePagesDone(DeletePageResult result); | 111 void OnDeletePagesDone(DeletePageResult result); |
| 113 | 112 |
| 114 // Always valid, this class is a member of the model. | 113 // Always valid, this class is a member of the model. |
| 115 OfflinePageModel* model_; | 114 OfflinePageModel* model_; |
| 116 | 115 |
| 117 State state_; | 116 State state_; |
| 118 | 117 |
| 119 // The cache of UI items. The key is DownloadUIItem.guid. | 118 // The cache of UI items. The key is DownloadUIItem.guid. |
| 120 DownloadUIItems items_; | 119 DownloadUIItems items_; |
| 121 | 120 |
| 122 // The observers. | 121 // The observers. |
| 123 base::ObserverList<Observer> observers_; | 122 base::ObserverList<Observer> observers_; |
| 124 int observers_count_; | 123 int observers_count_; |
| 125 | 124 |
| 126 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_; | 125 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_; |
| 127 | 126 |
| 128 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter); | 127 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter); |
| 129 }; | 128 }; |
| 130 | 129 |
| 131 } // namespace offline_pages | 130 } // namespace offline_pages |
| 132 | 131 |
| 133 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ | 132 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ |
| OLD | NEW |