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

Unified Diff: ios/chrome/browser/reading_list/reading_list_model_bridge_observer.mm

Issue 2525663002: Refactor Reading List Model to use URL as key. (Closed)
Patch Set: format 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/reading_list/reading_list_model_bridge_observer.mm
diff --git a/ios/chrome/browser/reading_list/reading_list_model_bridge_observer.mm b/ios/chrome/browser/reading_list/reading_list_model_bridge_observer.mm
index 5b6848bfcc48639c107c591fca07edf08fe561db..ac3a5e68d8ce874cb34e9c8cbe2fd6630fd7c118 100644
--- a/ios/chrome/browser/reading_list/reading_list_model_bridge_observer.mm
+++ b/ios/chrome/browser/reading_list/reading_list_model_bridge_observer.mm
@@ -34,39 +34,21 @@ void ReadingListModelBridge::ReadingListModelBeingDeleted(
model_ = nullptr;
}
-void ReadingListModelBridge::ReadingListWillRemoveUnreadEntry(
+void ReadingListModelBridge::ReadingListWillRemoveEntry(
const ReadingListModel* model,
- size_t index) {
- if ([observer_ respondsToSelector:@selector(readingListModel:
- willRemoveUnreadEntryAtIndex:)]) {
- [observer_ readingListModel:model willRemoveUnreadEntryAtIndex:index];
- }
-}
-
-void ReadingListModelBridge::ReadingListWillRemoveReadEntry(
- const ReadingListModel* model,
- size_t index) {
- if ([observer_ respondsToSelector:@selector(readingListModel:
- willRemoveReadEntryAtIndex:)]) {
- [observer_ readingListModel:model willRemoveReadEntryAtIndex:index];
- }
-}
-
-void ReadingListModelBridge::ReadingListWillAddReadEntry(
- const ReadingListModel* model,
- const ReadingListEntry& entry) {
+ const GURL& url) {
if ([observer_
- respondsToSelector:@selector(readingListModel:willAddReadEntry:)]) {
- [observer_ readingListModel:model willAddReadEntry:entry];
+ respondsToSelector:@selector(readingListModel:willRemoveEntry:)]) {
+ [observer_ readingListModel:model willRemoveEntry:url];
}
}
-void ReadingListModelBridge::ReadingListWillAddUnreadEntry(
+void ReadingListModelBridge::ReadingListWillAddEntry(
const ReadingListModel* model,
const ReadingListEntry& entry) {
if ([observer_
- respondsToSelector:@selector(readingListModel:willAddUnreadEntry:)]) {
- [observer_ readingListModel:model willAddUnreadEntry:entry];
+ respondsToSelector:@selector(readingListModel:willAddEntry:)]) {
+ [observer_ readingListModel:model willAddEntry:entry];
}
}
@@ -94,29 +76,18 @@ void ReadingListModelBridge::ReadingListModelCompletedBatchUpdates(
void ReadingListModelBridge::ReadingListWillMoveEntry(
const ReadingListModel* model,
- size_t index,
- bool read) {
- if ([observer_ respondsToSelector:@selector(readingListModel:
- willMoveEntry:
- isRead:)]) {
- [observer_ readingListModel:model willMoveEntry:index isRead:read];
- }
-}
-
-void ReadingListModelBridge::ReadingListWillUpdateUnreadEntry(
- const ReadingListModel* model,
- size_t index) {
- if ([observer_ respondsToSelector:@selector(readingListModel:
- willUpdateUnreadEntryAtIndex:)]) {
- [observer_ readingListModel:model willUpdateUnreadEntryAtIndex:index];
+ const GURL& url) {
+ if ([observer_
+ respondsToSelector:@selector(readingListModel:willMoveEntry:)]) {
+ [observer_ readingListModel:model willMoveEntry:url];
}
}
-void ReadingListModelBridge::ReadingListWillUpdateReadEntry(
+void ReadingListModelBridge::ReadingListWillUpdateEntry(
const ReadingListModel* model,
- size_t index) {
- if ([observer_ respondsToSelector:@selector(readingListModel:
- willUpdateReadEntryAtIndex:)]) {
- [observer_ readingListModel:model willUpdateReadEntryAtIndex:index];
+ const GURL& url) {
+ if ([observer_
+ respondsToSelector:@selector(readingListModel:willUpdateEntry:)]) {
+ [observer_ readingListModel:model willUpdateEntry:url];
}
}

Powered by Google App Engine
This is Rietveld 408576698