Chromium Code Reviews| 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 "ios/chrome/browser/reading_list/reading_list_model_observer.h" | 10 #include "ios/chrome/browser/reading_list/reading_list_model_observer.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 void ScheduleDownloadEntryFromURL(const GURL& url); | 73 void ScheduleDownloadEntryFromURL(const GURL& url); |
| 74 // Tries to save an offline version of the reading list entry if it is not yet | 74 // Tries to save an offline version of the reading list entry if it is not yet |
| 75 // saved. Must only be called after reading list model is loaded. | 75 // saved. Must only be called after reading list model is loaded. |
| 76 void DownloadEntry(const ReadingListEntry& entry); | 76 void DownloadEntry(const ReadingListEntry& entry); |
| 77 // Removes the offline version of the reading list entry if it exists. Must | 77 // Removes the offline version of the reading list entry if it exists. Must |
| 78 // only be called after reading list model is loaded. | 78 // only be called after reading list model is loaded. |
| 79 void RemoveDownloadedEntry(const ReadingListEntry& entry); | 79 void RemoveDownloadedEntry(const ReadingListEntry& entry); |
| 80 // Callback for entry download. | 80 // Callback for entry download. |
| 81 void OnDownloadEnd(const GURL& url, | 81 void OnDownloadEnd(const GURL& url, |
| 82 URLDownloader::SuccessState success, | 82 URLDownloader::SuccessState success, |
| 83 const GURL& distilled_url, | 83 const base::FilePath& distilled_url, |
|
jif-google
2016/11/10 15:48:24
s/distilled_url/distilled_path/
Olivier
2016/11/10 16:49:10
Done.
| |
| 84 const std::string& title); | 84 const std::string& title); |
| 85 | 85 |
| 86 // Callback for entry deletion. | 86 // Callback for entry deletion. |
| 87 void OnDeleteEnd(const GURL& url, bool success); | 87 void OnDeleteEnd(const GURL& url, bool success); |
| 88 | 88 |
| 89 // net::NetworkChangeNotifier::ConnectionTypeObserver: | 89 // net::NetworkChangeNotifier::ConnectionTypeObserver: |
| 90 void OnConnectionTypeChanged( | 90 void OnConnectionTypeChanged( |
| 91 net::NetworkChangeNotifier::ConnectionType type) override; | 91 net::NetworkChangeNotifier::ConnectionType type) override; |
| 92 | 92 |
| 93 ReadingListModel* reading_list_model_; | 93 ReadingListModel* reading_list_model_; |
| 94 std::unique_ptr<URLDownloader> url_downloader_; | 94 std::unique_ptr<URLDownloader> url_downloader_; |
| 95 std::vector<GURL> url_to_download_cellular_; | 95 std::vector<GURL> url_to_download_cellular_; |
| 96 std::vector<GURL> url_to_download_wifi_; | 96 std::vector<GURL> url_to_download_wifi_; |
| 97 bool had_connection_; | 97 bool had_connection_; |
| 98 | 98 |
| 99 base::WeakPtrFactory<ReadingListDownloadService> weak_ptr_factory_; | 99 base::WeakPtrFactory<ReadingListDownloadService> weak_ptr_factory_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(ReadingListDownloadService); | 101 DISALLOW_COPY_AND_ASSIGN(ReadingListDownloadService); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ | 104 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ |
| OLD | NEW |