| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 offline_pages::OfflinePageModel* offline_page_model); | 36 offline_pages::OfflinePageModel* offline_page_model); |
| 37 ~OfflinePageSuggestionsProvider() override; | 37 ~OfflinePageSuggestionsProvider() override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // ContentSuggestionsProvider implementation. | 40 // ContentSuggestionsProvider implementation. |
| 41 std::vector<Category> GetProvidedCategories() override; | 41 std::vector<Category> GetProvidedCategories() override; |
| 42 CategoryStatus GetCategoryStatus(Category category) override; | 42 CategoryStatus GetCategoryStatus(Category category) override; |
| 43 void DismissSuggestion(const std::string& suggestion_id) override; | 43 void DismissSuggestion(const std::string& suggestion_id) override; |
| 44 void FetchSuggestionImage(const std::string& suggestion_id, | 44 void FetchSuggestionImage(const std::string& suggestion_id, |
| 45 const ImageFetchedCallback& callback) override; | 45 const ImageFetchedCallback& callback) override; |
| 46 void ClearCachedSuggestionsForDebugging() override; | 46 void ClearCachedSuggestionsForDebugging(Category category) override; |
| 47 void ClearDismissedSuggestionsForDebugging() override; | 47 std::vector<ContentSuggestion> GetDismissedSuggestionsForDebugging( |
| 48 Category category) override; |
| 49 void ClearDismissedSuggestionsForDebugging(Category category) override; |
| 48 | 50 |
| 49 // OfflinePageModel::Observer implementation. | 51 // OfflinePageModel::Observer implementation. |
| 50 void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override; | 52 void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override; |
| 51 void OfflinePageModelChanged(offline_pages::OfflinePageModel* model) override; | 53 void OfflinePageModelChanged(offline_pages::OfflinePageModel* model) override; |
| 52 void OfflinePageDeleted(int64_t offline_id, | 54 void OfflinePageDeleted(int64_t offline_id, |
| 53 const offline_pages::ClientId& client_id) override; | 55 const offline_pages::ClientId& client_id) override; |
| 54 | 56 |
| 55 // Queries the OfflinePageModel for offline pages. | 57 // Queries the OfflinePageModel for offline pages. |
| 56 void FetchOfflinePages(); | 58 void FetchOfflinePages(); |
| 57 | 59 |
| 58 // Callback from the OfflinePageModel. | 60 // Callback from the OfflinePageModel. |
| 59 void OnOfflinePagesLoaded( | 61 void OnOfflinePagesLoaded( |
| 60 const offline_pages::MultipleOfflinePageItemResult& result); | 62 const offline_pages::MultipleOfflinePageItemResult& result); |
| 61 | 63 |
| 62 // Updates the |category_status_| and notifies the |observer_|, if necessary. | 64 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
| 63 void NotifyStatusChanged(CategoryStatus new_status); | 65 void NotifyStatusChanged(CategoryStatus new_status); |
| 64 | 66 |
| 65 CategoryStatus category_status_; | 67 CategoryStatus category_status_; |
| 66 | 68 |
| 67 offline_pages::OfflinePageModel* offline_page_model_; | 69 offline_pages::OfflinePageModel* offline_page_model_; |
| 68 | 70 |
| 69 const Category provided_category_; | 71 const Category provided_category_; |
| 70 | 72 |
| 71 DISALLOW_COPY_AND_ASSIGN(OfflinePageSuggestionsProvider); | 73 DISALLOW_COPY_AND_ASSIGN(OfflinePageSuggestionsProvider); |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 } // namespace ntp_snippets | 76 } // namespace ntp_snippets |
| 75 | 77 |
| 76 #endif // COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVID
ER_H_ | 78 #endif // COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGE_SUGGESTIONS_PROVID
ER_H_ |
| OLD | NEW |