OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H
_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H
_ |
6 #define COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H
_ | 6 #define COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H
_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 base::Time end, | 42 base::Time end, |
43 const base::Callback<bool(const GURL& url)>& filter) override; | 43 const base::Callback<bool(const GURL& url)>& filter) override; |
44 void ClearCachedSuggestions(Category category) override; | 44 void ClearCachedSuggestions(Category category) override; |
45 void GetDismissedSuggestionsForDebugging( | 45 void GetDismissedSuggestionsForDebugging( |
46 Category category, | 46 Category category, |
47 const DismissedSuggestionsCallback& callback) override; | 47 const DismissedSuggestionsCallback& callback) override; |
48 void ClearDismissedSuggestionsForDebugging(Category category) override; | 48 void ClearDismissedSuggestionsForDebugging(Category category) override; |
49 | 49 |
50 // ReadingListModelObserver implementation. | 50 // ReadingListModelObserver implementation. |
51 void ReadingListModelLoaded(const ReadingListModel* model) override; | 51 void ReadingListModelLoaded(const ReadingListModel* model) override; |
| 52 void ReadingListModelBeingDeleted(const ReadingListModel* model) override; |
52 | 53 |
53 private: | 54 private: |
| 55 // The actual method to fetch Reading List entries. Must be called after the |
| 56 // model is loaded. |
54 void FetchReadingListInternal(); | 57 void FetchReadingListInternal(); |
55 | 58 |
| 59 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
| 60 void NotifyStatusChanged(CategoryStatus new_status); |
56 CategoryStatus category_status_; | 61 CategoryStatus category_status_; |
57 const Category provided_category_; | 62 const Category provided_category_; |
58 | 63 |
59 ReadingListModel* reading_list_model_; | 64 ReadingListModel* reading_list_model_; |
60 | 65 |
61 DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider); | 66 DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider); |
62 }; | 67 }; |
63 | 68 |
64 } // namespace ntp_snippets | 69 } // namespace ntp_snippets |
65 | 70 |
66 #endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDE
R_H_ | 71 #endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDE
R_H_ |
OLD | NEW |