| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 54 |
| 55 private: | 55 private: |
| 56 // The actual method to fetch Reading List entries. Must be called after the | 56 // The actual method to fetch Reading List entries. Must be called after the |
| 57 // model is loaded. | 57 // model is loaded. |
| 58 void FetchReadingListInternal(); | 58 void FetchReadingListInternal(); |
| 59 | 59 |
| 60 // Converts |entry| to ContentSuggestion. |
| 61 ContentSuggestion ConvertEntry(const ReadingListEntry* entry); |
| 62 |
| 60 // Updates the |category_status_| and notifies the |observer_|, if necessary. | 63 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
| 61 void NotifyStatusChanged(CategoryStatus new_status); | 64 void NotifyStatusChanged(CategoryStatus new_status); |
| 62 CategoryStatus category_status_; | 65 CategoryStatus category_status_; |
| 63 const Category provided_category_; | 66 const Category provided_category_; |
| 64 | 67 |
| 65 ReadingListModel* reading_list_model_; | 68 ReadingListModel* reading_list_model_; |
| 66 ScopedObserver<ReadingListModel, ReadingListModelObserver> scoped_observer_; | 69 ScopedObserver<ReadingListModel, ReadingListModelObserver> scoped_observer_; |
| 67 | 70 |
| 68 DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider); | 71 DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 } // namespace ntp_snippets | 74 } // namespace ntp_snippets |
| 72 | 75 |
| 73 #endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDE
R_H_ | 76 #endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDE
R_H_ |
| OLD | NEW |