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

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

Issue 2436743002: Add GetEntryFromURL method to the ReadingListModel. (Closed)
Patch Set: Fixed test. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | ios/chrome/browser/reading_list/reading_list_model_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Returns the size of read and unread entries. 46 // Returns the size of read and unread entries.
47 virtual size_t unread_size() const = 0; 47 virtual size_t unread_size() const = 0;
48 virtual size_t read_size() const = 0; 48 virtual size_t read_size() const = 0;
49 49
50 // Returns true if there are entries in the model that were not seen by the 50 // Returns true if there are entries in the model that were not seen by the
51 // user yet. Reset to true when new unread entries are added. Reset to false 51 // user yet. Reset to true when new unread entries are added. Reset to false
52 // when ResetUnseenEntries is called. 52 // when ResetUnseenEntries is called.
53 virtual bool HasUnseenEntries() const = 0; 53 virtual bool HasUnseenEntries() const = 0;
54 virtual void ResetUnseenEntries() = 0; 54 virtual void ResetUnseenEntries() = 0;
55 55
56 // TODO(659099): Remove methods.
56 // Returns a specific entry. 57 // Returns a specific entry.
57 virtual const ReadingListEntry& GetUnreadEntryAtIndex(size_t index) const = 0; 58 virtual const ReadingListEntry& GetUnreadEntryAtIndex(size_t index) const = 0;
58 virtual const ReadingListEntry& GetReadEntryAtIndex(size_t index) const = 0; 59 virtual const ReadingListEntry& GetReadEntryAtIndex(size_t index) const = 0;
59 60
61 // Returns a specific entry. Returns null if the entry does not exist.
62 virtual const ReadingListEntry* GetEntryFromURL(const GURL& gurl) const = 0;
63
60 // Synchronously calls the |callback| with entry associated with this |url|. 64 // Synchronously calls the |callback| with entry associated with this |url|.
61 // Does nothing if there is no entry associated. 65 // Does nothing if there is no entry associated.
62 // Returns whether the callback has been called. 66 // Returns whether the callback has been called.
63 virtual bool CallbackEntryURL( 67 virtual bool CallbackEntryURL(
64 const GURL& url, 68 const GURL& url,
65 base::Callback<void(const ReadingListEntry&)> callback) const = 0; 69 base::Callback<void(const ReadingListEntry&)> callback) const = 0;
66 70
67 // Adds |url| at the top of the unread entries, and removes entries with the 71 // Adds |url| at the top of the unread entries, and removes entries with the
68 // same |url| from everywhere else if they exist. The addition may be 72 // same |url| from everywhere else if they exist. The addition may be
69 // asynchronous, and the data will be available only once the observers are 73 // asynchronous, and the data will be available only once the observers are
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // ReadingListBatchUpdateToken dtor. 127 // ReadingListBatchUpdateToken dtor.
124 virtual void EndBatchUpdates(); 128 virtual void EndBatchUpdates();
125 129
126 private: 130 private:
127 unsigned int current_batch_updates_count_; 131 unsigned int current_batch_updates_count_;
128 132
129 DISALLOW_COPY_AND_ASSIGN(ReadingListModel); 133 DISALLOW_COPY_AND_ASSIGN(ReadingListModel);
130 }; 134 };
131 135
132 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_H_ 136 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/reading_list/reading_list_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698