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