| 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_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ | 6 #define COMPONENTS_OFFLINE_PAGE_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 LOADED | 91 LOADED |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 struct ItemInfo { | 94 struct ItemInfo { |
| 95 explicit ItemInfo(const OfflinePageItem& page); | 95 explicit ItemInfo(const OfflinePageItem& page); |
| 96 ~ItemInfo(); | 96 ~ItemInfo(); |
| 97 | 97 |
| 98 std::unique_ptr<DownloadUIItem> ui_item; | 98 std::unique_ptr<DownloadUIItem> ui_item; |
| 99 // Additional cached data, not exposed to UI through DownloadUIItem. | 99 // Additional cached data, not exposed to UI through DownloadUIItem. |
| 100 int64_t offline_id; | 100 int64_t offline_id; |
| 101 GURL offline_url; | |
| 102 | 101 |
| 103 private: | 102 private: |
| 104 DISALLOW_COPY_AND_ASSIGN(ItemInfo); | 103 DISALLOW_COPY_AND_ASSIGN(ItemInfo); |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 typedef std::map<std::string, std::unique_ptr<ItemInfo>> DownloadUIItems; | 106 typedef std::map<std::string, std::unique_ptr<ItemInfo>> DownloadUIItems; |
| 108 | 107 |
| 109 void LoadCache(); | 108 void LoadCache(); |
| 110 void ClearCache(); | 109 void ClearCache(); |
| 111 | 110 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 128 int observers_count_; | 127 int observers_count_; |
| 129 | 128 |
| 130 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_; | 129 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_; |
| 131 | 130 |
| 132 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter); | 131 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter); |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 } // namespace offline_pages | 134 } // namespace offline_pages |
| 136 | 135 |
| 137 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ | 136 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ |
| OLD | NEW |