Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: components/ntp_snippets/content_suggestions_provider.h

Issue 2251743002: Refactor OfflinePageSuggestionsProvider dismissed ID handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@offlinedelete
Patch Set: Fire OnSuggestionInvalidated even if previously dismissed Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CONTENT_SUGGESTIONS_PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 Category category, 65 Category category,
66 CategoryStatus new_status) = 0; 66 CategoryStatus new_status) = 0;
67 67
68 // Called when a suggestion has been invalidated. It will not be provided 68 // Called when a suggestion has been invalidated. It will not be provided
69 // through |OnNewSuggestions| anymore, is not supported by 69 // through |OnNewSuggestions| anymore, is not supported by
70 // |FetchSuggestionImage| or |DismissSuggestion| anymore, and should 70 // |FetchSuggestionImage| or |DismissSuggestion| anymore, and should
71 // immediately be cleared from the UI and caches. This happens, for example, 71 // immediately be cleared from the UI and caches. This happens, for example,
72 // when the content that the suggestion refers to is gone. 72 // when the content that the suggestion refers to is gone.
73 // Note that this event may be fired even if the corresponding |category| is 73 // Note that this event may be fired even if the corresponding |category| is
74 // not currently AVAILABLE, because open UIs may still be showing the 74 // not currently AVAILABLE, because open UIs may still be showing the
75 // suggestion that is to be removed. 75 // suggestion that is to be removed. This event may also be fired for
76 // |suggestion_id|s that never existed and should be ignored in that case.
76 virtual void OnSuggestionInvalidated(ContentSuggestionsProvider* provider, 77 virtual void OnSuggestionInvalidated(ContentSuggestionsProvider* provider,
77 Category category, 78 Category category,
78 const std::string& suggestion_id) = 0; 79 const std::string& suggestion_id) = 0;
79 }; 80 };
80 81
81 virtual ~ContentSuggestionsProvider(); 82 virtual ~ContentSuggestionsProvider();
82 83
83 // Returns the categories provided by this provider. 84 // Returns the categories provided by this provider.
84 // When the set of provided categories changes, the Observer is notified 85 // When the set of provided categories changes, the Observer is notified
85 // through |OnNewSuggestions| or |OnCategoryStatusChanged| for added 86 // through |OnNewSuggestions| or |OnCategoryStatusChanged| for added
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 CategoryFactory* category_factory() const { return category_factory_; } 147 CategoryFactory* category_factory() const { return category_factory_; }
147 148
148 private: 149 private:
149 Observer* observer_; 150 Observer* observer_;
150 CategoryFactory* category_factory_; 151 CategoryFactory* category_factory_;
151 }; 152 };
152 153
153 } // namespace ntp_snippets 154 } // namespace ntp_snippets
154 155
155 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 156 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698