Chromium Code Reviews| 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..52b3071ba4ac83fb4d5822afcb0b604f45ac4344 |
| --- /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::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.
|
| + 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_ |