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

Side by Side Diff: components/ntp_snippets/content_suggestions_service.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_SERVICE_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // displayed to the user. The UI must immediately clear any suggestions of 48 // displayed to the user. The UI must immediately clear any suggestions of
49 // that category. 49 // that category.
50 virtual void OnCategoryStatusChanged(Category category, 50 virtual void OnCategoryStatusChanged(Category category,
51 CategoryStatus new_status) = 0; 51 CategoryStatus new_status) = 0;
52 52
53 // Fired when a suggestion has been invalidated. The UI must immediately 53 // Fired when a suggestion has been invalidated. The UI must immediately
54 // clear the suggestion even from open NTPs. Invalidation happens, for 54 // clear the suggestion even from open NTPs. Invalidation happens, for
55 // example, when the content that the suggestion refers to is gone. 55 // example, when the content that the suggestion refers to is gone.
56 // Note that this event may be fired even if the corresponding |category| is 56 // Note that this event may be fired even if the corresponding |category| is
57 // not currently AVAILABLE, because open UIs may still be showing the 57 // not currently AVAILABLE, because open UIs may still be showing the
58 // suggestion that is to be removed. 58 // suggestion that is to be removed. This event may also be fired for
59 // |suggestion_id|s that never existed and should be ignored in that case.
59 virtual void OnSuggestionInvalidated(Category category, 60 virtual void OnSuggestionInvalidated(Category category,
60 const std::string& suggestion_id) = 0; 61 const std::string& suggestion_id) = 0;
61 62
62 // Sent when the service is shutting down. After the service has shut down, 63 // Sent when the service is shutting down. After the service has shut down,
63 // it will not provide any data anymore, though calling the getters is still 64 // it will not provide any data anymore, though calling the getters is still
64 // safe. 65 // safe.
65 virtual void ContentSuggestionsServiceShutdown() = 0; 66 virtual void ContentSuggestionsServiceShutdown() = 0;
66 67
67 protected: 68 protected:
68 virtual ~Observer() {} 69 virtual ~Observer() {}
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // background fetching and debugging calls to it. If the NTPSnippetsService is 231 // background fetching and debugging calls to it. If the NTPSnippetsService is
231 // loaded, it is also present in |providers_|, otherwise this is a nullptr. 232 // loaded, it is also present in |providers_|, otherwise this is a nullptr.
232 NTPSnippetsService* ntp_snippets_service_; 233 NTPSnippetsService* ntp_snippets_service_;
233 234
234 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); 235 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService);
235 }; 236 };
236 237
237 } // namespace ntp_snippets 238 } // namespace ntp_snippets
238 239
239 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ 240 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698