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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_provider.h

Issue 2496163002: [NTP Snippets] Don't notify about new suggestion when in a not-available state (Closed)
Patch Set: add test; fix Created 4 years, 1 month 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
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Dismissed snippets, only for unit tests. 143 // Dismissed snippets, only for unit tests.
144 const NTPSnippet::PtrVector& GetDismissedSnippetsForTesting( 144 const NTPSnippet::PtrVector& GetDismissedSnippetsForTesting(
145 Category category) const { 145 Category category) const {
146 return category_contents_.find(category)->second.dismissed; 146 return category_contents_.find(category)->second.dismissed;
147 } 147 }
148 148
149 private: 149 private:
150 friend class RemoteSuggestionsProviderTest; 150 friend class RemoteSuggestionsProviderTest;
151 151
152 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest, 152 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest,
153 DontNotifyIfNotAvailable);
154 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest,
153 RemoveExpiredDismissedContent); 155 RemoveExpiredDismissedContent);
154 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest, 156 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest,
155 RescheduleOnStateChange); 157 RescheduleOnStateChange);
156 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest, StatusChanges); 158 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest, StatusChanges);
157 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest, 159 FRIEND_TEST_ALL_PREFIXES(RemoteSuggestionsProviderTest,
158 SuggestionsFetchedOnSignInAndSignOut); 160 SuggestionsFetchedOnSignInAndSignOut);
159 161
160 // Possible state transitions: 162 // Possible state transitions:
161 // NOT_INITED --------+ 163 // NOT_INITED --------+
162 // / \ | 164 // / \ |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 394
393 // Request throttler for limiting requests to thumbnail images. 395 // Request throttler for limiting requests to thumbnail images.
394 RequestThrottler thumbnail_requests_throttler_; 396 RequestThrottler thumbnail_requests_throttler_;
395 397
396 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsProvider); 398 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsProvider);
397 }; 399 };
398 400
399 } // namespace ntp_snippets 401 } // namespace ntp_snippets
400 402
401 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 403 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698