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

Unified Diff: components/reading_list/ios/reading_list_model_impl.cc

Issue 2745313004: Remove all ReadingList entries on managed account signout. (Closed)
Patch Set: feedback Created 3 years, 9 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 | « components/reading_list/ios/reading_list_model_impl.h ('k') | ios/chrome/browser/reading_list/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/reading_list/ios/reading_list_model_impl.cc
diff --git a/components/reading_list/ios/reading_list_model_impl.cc b/components/reading_list/ios/reading_list_model_impl.cc
index e922dff3cbc4259ee8e64cb8d3b4a74c9805bd9d..263caa9800a6fd20ca05aaa786f5a08c265ffed5 100644
--- a/components/reading_list/ios/reading_list_model_impl.cc
+++ b/components/reading_list/ios/reading_list_model_impl.cc
@@ -146,6 +146,18 @@ void ReadingListModelImpl::MarkAllSeen() {
DCHECK(unseen_entry_count_ == 0);
}
+bool ReadingListModelImpl::DeleteAllEntries() {
+ DCHECK(CalledOnValidThread());
+ if (!loaded()) {
+ return false;
+ }
+ auto scoped_model_batch_updates = BeginBatchUpdates();
+ for (const auto& url : Keys()) {
+ RemoveEntryByURL(url);
+ }
+ return entries_->empty();
+}
+
void ReadingListModelImpl::UpdateEntryStateCountersOnEntryRemoval(
const ReadingListEntry& entry) {
if (!entry.HasBeenSeen()) {
« no previous file with comments | « components/reading_list/ios/reading_list_model_impl.h ('k') | ios/chrome/browser/reading_list/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698