Index: components/ntp_snippets/ntp_snippets_fetcher.h |
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.h b/components/ntp_snippets/ntp_snippets_fetcher.h |
index eafc462999e8e27da69395fd94145ad2ef58d5a6..2892abace8c1921ad106e4e5c66934397544869f 100644 |
--- a/components/ntp_snippets/ntp_snippets_fetcher.h |
+++ b/components/ntp_snippets/ntp_snippets_fetcher.h |
@@ -47,7 +47,19 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer, |
using ParseJSONCallback = base::Callback< |
void(const std::string&, const SuccessCallback&, const ErrorCallback&)>; |
- using OptionalSnippets = base::Optional<NTPSnippet::CategoryMap>; |
+ struct FetchedCategory { |
+ Category category; |
+ base::string16 localized_title; // Ignored for non-server categories. |
+ NTPSnippet::PtrVector snippets; |
+ |
+ FetchedCategory(Category c); |
+ FetchedCategory(FetchedCategory&&); // = default, in .cc |
+ ~FetchedCategory(); // = default, in .cc |
+ FetchedCategory& operator=(FetchedCategory&&); // = default, in .cc |
+ }; |
+ using FetchedCategoriesVector = std::vector<FetchedCategory>; |
+ using OptionalSnippets = base::Optional<FetchedCategoriesVector>; |
+ |
// |snippets| contains parsed snippets if a fetch succeeded. If problems |
// occur, |snippets| contains no value (no actual vector in base::Optional). |
// Error details can be retrieved using last_status(). |
@@ -183,7 +195,7 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer, |
void OnURLFetchComplete(const net::URLFetcher* source) override; |
bool JsonToSnippets(const base::Value& parsed, |
- NTPSnippet::CategoryMap* snippets); |
+ FetchedCategoriesVector* categories); |
void OnJsonParsed(std::unique_ptr<base::Value> parsed); |
void OnJsonError(const std::string& error); |
void FetchFinished(OptionalSnippets snippets, |