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

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

Issue 2158883002: Change NTPSnippetsBridge to read from ContentSuggestionsService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@offlinepagesprovider
Patch Set: Created 4 years, 5 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 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_NTP_SNIPPETS_SERVICE_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 std::set<std::string> GetSuggestionsHosts() const; 146 std::set<std::string> GetSuggestionsHosts() const;
147 147
148 // Observer accessors. 148 // Observer accessors.
149 void AddObserver(NTPSnippetsServiceObserver* observer); 149 void AddObserver(NTPSnippetsServiceObserver* observer);
150 void RemoveObserver(NTPSnippetsServiceObserver* observer); 150 void RemoveObserver(NTPSnippetsServiceObserver* observer);
151 151
152 // Returns the maximum number of snippets that will be shown at once. 152 // Returns the maximum number of snippets that will be shown at once.
153 static int GetMaxSnippetCountForTesting(); 153 static int GetMaxSnippetCountForTesting();
154 154
155 private: 155 private:
156 friend class NTPSnippetsServiceTest;
156 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, HistorySyncStateChanges); 157 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, HistorySyncStateChanges);
157 158
158 // TODO(pke): As soon as the DisabledReason is replaced with the new status, 159 // TODO(pke): As soon as the DisabledReason is replaced with the new status,
159 // also remove the old State enum and replace it with 160 // also remove the old State enum and replace it with
160 // ContentSuggestionsCategoryStatus and a similar status diagram. 161 // ContentSuggestionsCategoryStatus and a similar status diagram.
161 // Possible state transitions: 162 // Possible state transitions:
162 // +------- NOT_INITED ------+ 163 // +------- NOT_INITED ------+
163 // | / \ | 164 // | / \ |
164 // | READY <--> DISABLED <-+ 165 // | READY <--> DISABLED <-+
165 // | \ / 166 // | \ /
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 // If the service might be enabled, DisabledReason::NONE will be provided. 337 // If the service might be enabled, DisabledReason::NONE will be provided.
337 virtual void NTPSnippetsServiceDisabledReasonChanged(DisabledReason) = 0; 338 virtual void NTPSnippetsServiceDisabledReasonChanged(DisabledReason) = 0;
338 339
339 protected: 340 protected:
340 virtual ~NTPSnippetsServiceObserver() {} 341 virtual ~NTPSnippetsServiceObserver() {}
341 }; 342 };
342 343
343 } // namespace ntp_snippets 344 } // namespace ntp_snippets
344 345
345 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 346 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698