| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVIDER_
H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVIDER_
H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVIDER_
H_ | 6 #define COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVIDER_
H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // ContentSuggestionsProvider implementation. | 50 // ContentSuggestionsProvider implementation. |
| 51 std::vector<Category> GetProvidedCategories() override; | 51 std::vector<Category> GetProvidedCategories() override; |
| 52 CategoryStatus GetCategoryStatus(Category category) override; | 52 CategoryStatus GetCategoryStatus(Category category) override; |
| 53 CategoryInfo GetCategoryInfo(Category category) override; | 53 CategoryInfo GetCategoryInfo(Category category) override; |
| 54 void DismissSuggestion(const std::string& suggestion_id) override; | 54 void DismissSuggestion(const std::string& suggestion_id) override; |
| 55 void FetchSuggestionImage(const std::string& suggestion_id, | 55 void FetchSuggestionImage(const std::string& suggestion_id, |
| 56 const ImageFetchedCallback& callback) override; | 56 const ImageFetchedCallback& callback) override; |
| 57 void ClearCachedSuggestionsForDebugging(Category category) override; | 57 void ClearCachedSuggestionsForDebugging(Category category) override; |
| 58 std::vector<ContentSuggestion> GetDismissedSuggestionsForDebugging( | 58 void GetDismissedSuggestionsForDebugging( |
| 59 Category category) override; | 59 Category category, |
| 60 const DismissedSuggestionsCallback& callback) override; |
| 60 void ClearDismissedSuggestionsForDebugging(Category category) override; | 61 void ClearDismissedSuggestionsForDebugging(Category category) override; |
| 61 | 62 |
| 62 // OfflinePageModel::Observer implementation. | 63 // OfflinePageModel::Observer implementation. |
| 63 void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override; | 64 void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override; |
| 64 void OfflinePageModelChanged(offline_pages::OfflinePageModel* model) override; | 65 void OfflinePageModelChanged(offline_pages::OfflinePageModel* model) override; |
| 65 void OfflinePageDeleted(int64_t offline_id, | 66 void OfflinePageDeleted(int64_t offline_id, |
| 66 const offline_pages::ClientId& client_id) override; | 67 const offline_pages::ClientId& client_id) override; |
| 67 | 68 |
| 68 // Queries the OfflinePageModel for offline pages. | 69 // Queries the OfflinePageModel for offline pages. |
| 69 void FetchOfflinePages(); | 70 void FetchOfflinePages(); |
| 70 | 71 |
| 71 // Callback from the OfflinePageModel. | 72 // Callback from the OfflinePageModel. |
| 72 void OnOfflinePagesLoaded( | 73 void OnOfflinePagesLoaded( |
| 73 const offline_pages::MultipleOfflinePageItemResult& result); | 74 const offline_pages::MultipleOfflinePageItemResult& result); |
| 75 void OnOfflinePagesLoadedForDismissedDebugging( |
| 76 Category category, |
| 77 const DismissedSuggestionsCallback& callback, |
| 78 const offline_pages::MultipleOfflinePageItemResult& result); |
| 74 | 79 |
| 75 // Updates the |category_status_| of the |category| and notifies the | 80 // Updates the |category_status_| of the |category| and notifies the |
| 76 // |observer_|, if necessary. | 81 // |observer_|, if necessary. |
| 77 void NotifyStatusChanged(Category category, CategoryStatus new_status); | 82 void NotifyStatusChanged(Category category, CategoryStatus new_status); |
| 78 | 83 |
| 79 // Converts an OfflinePageItem to a ContentSuggestion for the |category|. | 84 // Converts an OfflinePageItem to a ContentSuggestion for the |category|. |
| 80 ContentSuggestion ConvertOfflinePage( | 85 ContentSuggestion ConvertOfflinePage( |
| 81 Category category, | 86 Category category, |
| 82 const offline_pages::OfflinePageItem& offline_page) const; | 87 const offline_pages::OfflinePageItem& offline_page) const; |
| 83 | 88 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Whether the Download Manager UI is enabled, in which case the More button | 123 // Whether the Download Manager UI is enabled, in which case the More button |
| 119 // for the Downloads section can redirect there. | 124 // for the Downloads section can redirect there. |
| 120 const bool download_manager_ui_enabled_; | 125 const bool download_manager_ui_enabled_; |
| 121 | 126 |
| 122 DISALLOW_COPY_AND_ASSIGN(OfflinePageSuggestionsProvider); | 127 DISALLOW_COPY_AND_ASSIGN(OfflinePageSuggestionsProvider); |
| 123 }; | 128 }; |
| 124 | 129 |
| 125 } // namespace ntp_snippets | 130 } // namespace ntp_snippets |
| 126 | 131 |
| 127 #endif // COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVID
ER_H_ | 132 #endif // COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVID
ER_H_ |
| OLD | NEW |