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

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

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
Index: ios/chrome/browser/reading_list/reading_list_remover_helper.h
diff --git a/ios/chrome/browser/reading_list/reading_list_remover_helper.h b/ios/chrome/browser/reading_list/reading_list_remover_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..2373de761cc433ad3151b2d22e73c35804a7dc0a
--- /dev/null
+++ b/ios/chrome/browser/reading_list/reading_list_remover_helper.h
@@ -0,0 +1,44 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_REMOVER_HELPER_H_
+#define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_REMOVER_HELPER_H_
+
+#include "base/callback.h"
+#include "base/scoped_observer.h"
+#include "components/reading_list/ios/reading_list_model_observer.h"
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+class ReadingListModel;
+class ReadingListDownloadService;
+
+namespace reading_list {
+class ReadingListRemoverHelper : public ReadingListModelObserver {
+ public:
+ using Callback = base::OnceCallback<void(bool)>;
+ ReadingListRemoverHelper(ios::ChromeBrowserState* browser_state);
+ ~ReadingListRemoverHelper() override;
+
+ // Removes all Reading list items and call completion with |true| if the
+ // cleaning was successful.
+ void RemoveAllUserReadingListItemsIOS(Callback completion);
+
+ // ReadingListModelObserver implementation.
+ void ReadingListModelLoaded(const ReadingListModel* model) override;
+ void ReadingListModelBeingDeleted(const ReadingListModel* model) override;
+
+ private:
+ Callback completion_;
+ ReadingListModel* reading_list_model_;
+ ReadingListDownloadService* reading_list_download_service_;
+ ScopedObserver<ReadingListModel, ReadingListModelObserver> scoped_observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(ReadingListRemoverHelper);
+};
+} // namespace reading_list
+
+#endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_REMOVER_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698