| 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 IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ | 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ |
| 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ | 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/keyed_service/core/keyed_service.h" | 9 #include "components/keyed_service/core/keyed_service.h" |
| 10 #include "components/reading_list/ios/reading_list_model_observer.h" | 10 #include "components/reading_list/ios/reading_list_model_observer.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // saved. Must only be called after reading list model is loaded. | 83 // saved. Must only be called after reading list model is loaded. |
| 84 void DownloadEntry(const GURL& url); | 84 void DownloadEntry(const GURL& url); |
| 85 // Removes the offline version of the reading list entry if it exists. Must | 85 // Removes the offline version of the reading list entry if it exists. Must |
| 86 // only be called after reading list model is loaded. | 86 // only be called after reading list model is loaded. |
| 87 void RemoveDownloadedEntry(const GURL& url); | 87 void RemoveDownloadedEntry(const GURL& url); |
| 88 // Callback for entry download. | 88 // Callback for entry download. |
| 89 void OnDownloadEnd(const GURL& url, | 89 void OnDownloadEnd(const GURL& url, |
| 90 const GURL& distilled_url, | 90 const GURL& distilled_url, |
| 91 URLDownloader::SuccessState success, | 91 URLDownloader::SuccessState success, |
| 92 const base::FilePath& distilled_path, | 92 const base::FilePath& distilled_path, |
| 93 int64_t size, |
| 93 const std::string& title); | 94 const std::string& title); |
| 94 | 95 |
| 95 // Callback for entry deletion. | 96 // Callback for entry deletion. |
| 96 void OnDeleteEnd(const GURL& url, bool success); | 97 void OnDeleteEnd(const GURL& url, bool success); |
| 97 | 98 |
| 98 // net::NetworkChangeNotifier::ConnectionTypeObserver: | 99 // net::NetworkChangeNotifier::ConnectionTypeObserver: |
| 99 void OnConnectionTypeChanged( | 100 void OnConnectionTypeChanged( |
| 100 net::NetworkChangeNotifier::ConnectionType type) override; | 101 net::NetworkChangeNotifier::ConnectionType type) override; |
| 101 | 102 |
| 102 ReadingListModel* reading_list_model_; | 103 ReadingListModel* reading_list_model_; |
| 103 base::FilePath chrome_profile_path_; | 104 base::FilePath chrome_profile_path_; |
| 104 std::unique_ptr<URLDownloader> url_downloader_; | 105 std::unique_ptr<URLDownloader> url_downloader_; |
| 105 std::vector<GURL> url_to_download_cellular_; | 106 std::vector<GURL> url_to_download_cellular_; |
| 106 std::vector<GURL> url_to_download_wifi_; | 107 std::vector<GURL> url_to_download_wifi_; |
| 107 bool had_connection_; | 108 bool had_connection_; |
| 108 std::unique_ptr<reading_list::ReadingListDistillerPageFactory> | 109 std::unique_ptr<reading_list::ReadingListDistillerPageFactory> |
| 109 distiller_page_factory_; | 110 distiller_page_factory_; |
| 110 std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory_; | 111 std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory_; |
| 111 | 112 |
| 112 base::WeakPtrFactory<ReadingListDownloadService> weak_ptr_factory_; | 113 base::WeakPtrFactory<ReadingListDownloadService> weak_ptr_factory_; |
| 113 | 114 |
| 114 DISALLOW_COPY_AND_ASSIGN(ReadingListDownloadService); | 115 DISALLOW_COPY_AND_ASSIGN(ReadingListDownloadService); |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ | 118 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ |
| OLD | NEW |