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

Unified Diff: ios/chrome/browser/reading_list/reading_list_model.h

Issue 2352973002: Method to call a method with an entry based on its url (Closed)
Patch Set: Add tests 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/reading_list/reading_list_model.h
diff --git a/ios/chrome/browser/reading_list/reading_list_model.h b/ios/chrome/browser/reading_list/reading_list_model.h
index 7f76e48525e02ba67ca18849ff966edc27c1c845..9dc2d38240121d75af757cbab94eedcd46297039 100644
--- a/ios/chrome/browser/reading_list/reading_list_model.h
+++ b/ios/chrome/browser/reading_list/reading_list_model.h
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
+#include "base/callback.h"
#include "base/observer_list.h"
#include "ios/chrome/browser/reading_list/reading_list_entry.h"
#include "ios/chrome/browser/reading_list/reading_list_model_observer.h"
@@ -56,6 +57,13 @@ class ReadingListModel {
virtual const ReadingListEntry& GetUnreadEntryAtIndex(size_t index) const = 0;
virtual const ReadingListEntry& GetReadEntryAtIndex(size_t index) const = 0;
+ // Synchronously calls the |callback| with entry associated with this |url|.
+ // Does nothing if there is no entry associated.
+ // Returns whether the callback has been called.
+ virtual bool CallbackEntryURL(
+ const GURL& url,
+ base::Callback<void(const ReadingListEntry&)> callback) const = 0;
+
// Adds |url| at the top of the unread entries, and removes entries with the
// same |url| from everywhere else if they exist. The addition may be
// asynchronous, and the data will be available only once the observers are
« 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