| 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_MODEL_H_ | 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_H_ |
| 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_H_ | 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // already. This may trigger deletion of old read entries. | 85 // already. This may trigger deletion of old read entries. |
| 86 virtual void MarkReadByURL(const GURL& url) = 0; | 86 virtual void MarkReadByURL(const GURL& url) = 0; |
| 87 // If the |url| is in the reading list and read, mark it unread. If it is in | 87 // If the |url| is in the reading list and read, mark it unread. If it is in |
| 88 // the reading list and unread, move it to the top of read if it is not here | 88 // the reading list and unread, move it to the top of read if it is not here |
| 89 // already. | 89 // already. |
| 90 virtual void MarkUnreadByURL(const GURL& url) = 0; | 90 virtual void MarkUnreadByURL(const GURL& url) = 0; |
| 91 | 91 |
| 92 // Methods to mutate an entry. Will locate the relevant entry by URL. Does | 92 // Methods to mutate an entry. Will locate the relevant entry by URL. Does |
| 93 // nothing if the entry is not found. | 93 // nothing if the entry is not found. |
| 94 virtual void SetEntryTitle(const GURL& url, const std::string& title) = 0; | 94 virtual void SetEntryTitle(const GURL& url, const std::string& title) = 0; |
| 95 virtual void SetEntryDistilledURL(const GURL& url, | 95 virtual void SetEntryDistilledPath(const GURL& url, |
| 96 const GURL& distilled_url) = 0; | 96 const base::FilePath& distilled_path) = 0; |
| 97 virtual void SetEntryDistilledState( | 97 virtual void SetEntryDistilledState( |
| 98 const GURL& url, | 98 const GURL& url, |
| 99 ReadingListEntry::DistillationState state) = 0; | 99 ReadingListEntry::DistillationState state) = 0; |
| 100 | 100 |
| 101 // Observer registration methods. The model will remove all observers upon | 101 // Observer registration methods. The model will remove all observers upon |
| 102 // destruction automatically. | 102 // destruction automatically. |
| 103 void AddObserver(ReadingListModelObserver* observer); | 103 void AddObserver(ReadingListModelObserver* observer); |
| 104 void RemoveObserver(ReadingListModelObserver* observer); | 104 void RemoveObserver(ReadingListModelObserver* observer); |
| 105 | 105 |
| 106 // Helper class that is used to scope batch updates. | 106 // Helper class that is used to scope batch updates. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 128 // ReadingListBatchUpdateToken dtor. | 128 // ReadingListBatchUpdateToken dtor. |
| 129 virtual void EndBatchUpdates(); | 129 virtual void EndBatchUpdates(); |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 unsigned int current_batch_updates_count_; | 132 unsigned int current_batch_updates_count_; |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); | 134 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_H_ | 137 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_H_ |
| OLD | NEW |