| 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_ENTRY_H_ | 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ |
| 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ | 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // The URL of the page the user would like to read later. | 27 // The URL of the page the user would like to read later. |
| 28 const GURL& URL() const; | 28 const GURL& URL() const; |
| 29 // The title of the entry. Might be empty. | 29 // The title of the entry. Might be empty. |
| 30 const std::string Title() const; | 30 const std::string Title() const; |
| 31 // What state this entry is in. | 31 // What state this entry is in. |
| 32 DistillationState DistilledState() const; | 32 DistillationState DistilledState() const; |
| 33 // The local file URL for the distilled version of the page. This should only | 33 // The local file URL for the distilled version of the page. This should only |
| 34 // be called if the state is "PROCESSED". | 34 // be called if the state is "PROCESSED". |
| 35 const GURL& DistilledURL() const; | 35 const GURL& DistilledURL() const; |
| 36 // The number of times this entry has failed to download the distilled version |
| 37 // of the page since its creation or the last PROCESSED state. |
| 38 // This counter is automatically increased when the state is set to WILL_RETRY |
| 39 // or ERROR. |
| 40 int FailedDistillationCounter() const; |
| 36 | 41 |
| 37 ReadingListEntry& operator=(const ReadingListEntry& other); | 42 ReadingListEntry& operator=(const ReadingListEntry& other); |
| 38 bool operator==(const ReadingListEntry& other) const; | 43 bool operator==(const ReadingListEntry& other) const; |
| 39 | 44 |
| 40 // Sets the title. | 45 // Sets the title. |
| 41 void SetTitle(const std::string& title); | 46 void SetTitle(const std::string& title); |
| 42 // Sets the distilled URL and switch the state to PROCESSED. | 47 // Sets the distilled URL and switch the state to PROCESSED. |
| 43 void SetDistilledURL(const GURL& url); | 48 void SetDistilledURL(const GURL& url); |
| 44 // Sets the state to one of PROCESSING, WILL_RETRY or ERROR. | 49 // Sets the state to one of PROCESSING, WILL_RETRY or ERROR. |
| 45 void SetDistilledState(DistillationState distilled_state); | 50 void SetDistilledState(DistillationState distilled_state); |
| 46 | 51 |
| 47 private: | 52 private: |
| 48 GURL url_; | 53 GURL url_; |
| 49 std::string title_; | 54 std::string title_; |
| 50 GURL distilled_url_; | 55 GURL distilled_url_; |
| 51 DistillationState distilled_state_; | 56 DistillationState distilled_state_; |
| 57 int failed_distillation_counter_; |
| 52 }; | 58 }; |
| 53 | 59 |
| 54 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ | 60 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ |
| OLD | NEW |