Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |