Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: ios/chrome/browser/reading_list/reading_list_download_service.h

Issue 2320403002: Update reading list entry on download (Closed)
Patch Set: address comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "ios/chrome/browser/reading_list/url_downloader.h"
11 12
12 class GURL; 13 class GURL;
13 class PrefService; 14 class PrefService;
14 class URLDownloader;
15 class ReadingListModel; 15 class ReadingListModel;
16 namespace base { 16 namespace base {
17 class FilePath; 17 class FilePath;
18 } 18 }
19 19
20 namespace dom_distiller { 20 namespace dom_distiller {
21 class DomDistillerService; 21 class DomDistillerService;
22 } 22 }
23 23
24 // Observes the reading list and downloads offline versions of its articles. 24 // Observes the reading list and downloads offline versions of its articles.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Tries to save offline versions of all entries in the reading list that are 56 // Tries to save offline versions of all entries in the reading list that are
57 // not yet saved. Must only be called after reading list model is loaded. 57 // not yet saved. Must only be called after reading list model is loaded.
58 void DownloadAllEntries(); 58 void DownloadAllEntries();
59 // Tries to save an offline version of the reading list entry if it is not yet 59 // Tries to save an offline version of the reading list entry if it is not yet
60 // saved. Must only be called after reading list model is loaded. 60 // saved. Must only be called after reading list model is loaded.
61 void DownloadEntry(const ReadingListEntry& entry); 61 void DownloadEntry(const ReadingListEntry& entry);
62 // Removes the offline version of the reading list entry if it exists. Must 62 // Removes the offline version of the reading list entry if it exists. Must
63 // only be called after reading list model is loaded. 63 // only be called after reading list model is loaded.
64 void RemoveDownloadedEntry(const ReadingListEntry& entry); 64 void RemoveDownloadedEntry(const ReadingListEntry& entry);
65 // Callback for entry download. 65 // Callback for entry download.
66 void OnDownloadEnd(const GURL& url, bool success); 66 void OnDownloadEnd(const GURL& url,
67 URLDownloader::SuccessState success,
68 const GURL& distilled_url,
69 const std::string& title);
67 70
68 // Callback for entry deletion. 71 // Callback for entry deletion.
69 void OnDeleteEnd(const GURL& url, bool success); 72 void OnDeleteEnd(const GURL& url, bool success);
70 73
71 ReadingListModel* reading_list_model_; 74 ReadingListModel* reading_list_model_;
72 std::unique_ptr<URLDownloader> url_downloader_; 75 std::unique_ptr<URLDownloader> url_downloader_;
73 76
74 DISALLOW_COPY_AND_ASSIGN(ReadingListDownloadService); 77 DISALLOW_COPY_AND_ASSIGN(ReadingListDownloadService);
75 }; 78 };
76 79
77 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_ 80 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DOWNLOAD_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698