| 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 COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ | 5 #ifndef COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ |
| 6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ | 6 #define COMPONENTS_READING_LIST_IOS_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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 // Returns true if there are entries in the model that were not seen by the | 72 // Returns true if there are entries in the model that were not seen by the |
| 73 // user yet. Reset to true when new unread entries are added. Reset to false | 73 // user yet. Reset to true when new unread entries are added. Reset to false |
| 74 // when ResetUnseenEntries is called. | 74 // when ResetUnseenEntries is called. |
| 75 virtual bool HasUnseenEntries() const = 0; | 75 virtual bool HasUnseenEntries() const = 0; |
| 76 virtual void ResetUnseenEntries() = 0; | 76 virtual void ResetUnseenEntries() = 0; |
| 77 | 77 |
| 78 // Returns a specific entry. Returns null if the entry does not exist. | 78 // Returns a specific entry. Returns null if the entry does not exist. |
| 79 virtual const ReadingListEntry* GetEntryByURL(const GURL& gurl) const = 0; | 79 virtual const ReadingListEntry* GetEntryByURL(const GURL& gurl) const = 0; |
| 80 | 80 |
| 81 // Returns the first unread entry. If |distilled| is true, prioritize the |
| 82 // entries available offline. |
| 83 virtual const ReadingListEntry* GetFirstUnreadEntry(bool distilled) const = 0; |
| 84 |
| 81 // Adds |url| at the top of the unread entries, and removes entries with the | 85 // Adds |url| at the top of the unread entries, and removes entries with the |
| 82 // same |url| from everywhere else if they exist. The entry title will be a | 86 // same |url| from everywhere else if they exist. The entry title will be a |
| 83 // trimmed copy of |title. | 87 // trimmed copy of |title. |
| 84 // The addition may be asynchronous, and the data will be available only once | 88 // The addition may be asynchronous, and the data will be available only once |
| 85 // the observers are notified. | 89 // the observers are notified. |
| 86 virtual const ReadingListEntry& AddEntry(const GURL& url, | 90 virtual const ReadingListEntry& AddEntry(const GURL& url, |
| 87 const std::string& title) = 0; | 91 const std::string& title) = 0; |
| 88 | 92 |
| 89 // Removes an entry. The removal may be asynchronous, and not happen | 93 // Removes an entry. The removal may be asynchronous, and not happen |
| 90 // immediately. | 94 // immediately. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Called when model is leaving batch update mode. | 144 // Called when model is leaving batch update mode. |
| 141 virtual void LeavingBatchUpdates(); | 145 virtual void LeavingBatchUpdates(); |
| 142 | 146 |
| 143 private: | 147 private: |
| 144 unsigned int current_batch_updates_count_; | 148 unsigned int current_batch_updates_count_; |
| 145 | 149 |
| 146 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); | 150 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); |
| 147 }; | 151 }; |
| 148 | 152 |
| 149 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ | 153 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_H_ |
| OLD | NEW |