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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 const base::Callback<bool(const GURL& url)>& filter) override; | 44 const base::Callback<bool(const GURL& url)>& filter) override; |
45 void ClearCachedSuggestions(Category category) override; | 45 void ClearCachedSuggestions(Category category) override; |
46 void GetDismissedSuggestionsForDebugging( | 46 void GetDismissedSuggestionsForDebugging( |
47 Category category, | 47 Category category, |
48 const DismissedSuggestionsCallback& callback) override; | 48 const DismissedSuggestionsCallback& callback) override; |
49 void ClearDismissedSuggestionsForDebugging(Category category) override; | 49 void ClearDismissedSuggestionsForDebugging(Category category) override; |
50 | 50 |
51 // ReadingListModelObserver implementation. | 51 // ReadingListModelObserver implementation. |
52 void ReadingListModelLoaded(const ReadingListModel* model) override; | 52 void ReadingListModelLoaded(const ReadingListModel* model) override; |
53 void ReadingListModelBeingDeleted(const ReadingListModel* model) override; | 53 void ReadingListModelBeingDeleted(const ReadingListModel* model) override; |
| 54 void ReadingListDidApplyChanges(ReadingListModel* model) override; |
| 55 void ReadingListModelCompletedBatchUpdates( |
| 56 const ReadingListModel* model) override; |
54 | 57 |
55 private: | 58 private: |
56 // The actual method to fetch Reading List entries. Must be called after the | 59 // The actual method to fetch Reading List entries. Must be called after the |
57 // model is loaded. | 60 // model is loaded. |
58 void FetchReadingListInternal(); | 61 void FetchReadingListInternal(); |
59 | 62 |
60 // Converts |entry| to ContentSuggestion. | 63 // Converts |entry| to ContentSuggestion. |
61 ContentSuggestion ConvertEntry(const ReadingListEntry* entry); | 64 ContentSuggestion ConvertEntry(const ReadingListEntry* entry); |
62 | 65 |
63 // Updates the |category_status_| and notifies the |observer_|, if necessary. | 66 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
64 void NotifyStatusChanged(CategoryStatus new_status); | 67 void NotifyStatusChanged(CategoryStatus new_status); |
65 CategoryStatus category_status_; | 68 CategoryStatus category_status_; |
66 const Category provided_category_; | 69 const Category provided_category_; |
67 | 70 |
68 ReadingListModel* reading_list_model_; | 71 ReadingListModel* reading_list_model_; |
69 ScopedObserver<ReadingListModel, ReadingListModelObserver> scoped_observer_; | 72 ScopedObserver<ReadingListModel, ReadingListModelObserver> scoped_observer_; |
70 | 73 |
71 DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider); | 74 DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace ntp_snippets | 77 } // namespace ntp_snippets |
75 | 78 |
76 #endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDE
R_H_ | 79 #endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDE
R_H_ |
OLD | NEW |