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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_REMOVER_HELPER_H_
6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_REMOVER_HELPER_H_
7
8 #include "base/callback.h"
9 #include "base/scoped_observer.h"
10 #include "components/reading_list/ios/reading_list_model_observer.h"
11
12 namespace ios {
13 class ChromeBrowserState;
14 }
15
16 class ReadingListModel;
17 class ReadingListDownloadService;
18
19 namespace reading_list {
20 class ReadingListRemoverHelper : public ReadingListModelObserver {
21 public:
22 using Callback = base::Callback<void(bool)>;
msarda 2017/03/14 18:46:06 Consider using a OnceCallback (see https://cs.chro
Olivier 2017/03/15 09:17:40 I will take a look to OnceCallback
Olivier 2017/03/16 11:56:34 Done.
23 ReadingListRemoverHelper(ios::ChromeBrowserState* browser_state);
24 ~ReadingListRemoverHelper() override;
25
26 // Removes all Reading list items and call completion with |true| if the
27 // cleaning was successful.
28 void RemoveAllUserReadingListItemsIOS(Callback completion);
29
30 // ReadingListModelObserver implementation.
31 void ReadingListModelLoaded(const ReadingListModel* model) override;
32 void ReadingListModelBeingDeleted(const ReadingListModel* model) override;
33
34 private:
35 Callback completion_;
36 ReadingListModel* reading_list_model_;
37 ReadingListDownloadService* reading_list_download_service_;
38 ScopedObserver<ReadingListModel, ReadingListModelObserver> scoped_observer_;
39
40 DISALLOW_COPY_AND_ASSIGN(ReadingListRemoverHelper);
41 };
42 } // namespace reading_list
43
44 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_REMOVER_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698