Chromium Code Reviews| Index: components/ntp_snippets/ntp_snippets_service.h |
| diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h |
| index 7a4571820f20115cfdb7e3544302d0112cc7cc40..827500dcbb2d907080443123dceaa206e046d6b2 100644 |
| --- a/components/ntp_snippets/ntp_snippets_service.h |
| +++ b/components/ntp_snippets/ntp_snippets_service.h |
| @@ -18,7 +18,6 @@ |
| #include "base/sequenced_task_runner.h" |
| #include "base/timer/timer.h" |
| #include "components/keyed_service/core/keyed_service.h" |
| -#include "components/ntp_snippets/inner_iterator.h" |
| #include "components/ntp_snippets/ntp_snippet.h" |
| #include "components/ntp_snippets/ntp_snippets_fetcher.h" |
| #include "components/ntp_snippets/ntp_snippets_scheduler.h" |
| @@ -48,8 +47,6 @@ class NTPSnippetsServiceObserver; |
| class NTPSnippetsService : public KeyedService { |
| public: |
| using NTPSnippetStorage = NTPSnippet::PtrVector; |
| - using const_iterator = |
| - InnerIterator<NTPSnippetStorage::const_iterator, const NTPSnippet>; |
| using ImageFetchedCallback = |
| base::Callback<void(const GURL&, const SkBitmap*)>; |
| @@ -122,18 +119,8 @@ class NTPSnippetsService : public KeyedService { |
| void AddObserver(NTPSnippetsServiceObserver* observer); |
| void RemoveObserver(NTPSnippetsServiceObserver* observer); |
| - // Number of snippets available. |
| - size_t size() const { return snippets_.size(); } |
| - |
| - // The snippets can be iterated upon only via a const_iterator. Recommended |
| - // way to iterate is as follows: |
| - // |
| - // NTPSnippetsService* service; // Assume is set. |
| - // for (auto& snippet : *service) { |
| - // // |snippet| here is a const object. |
| - // } |
| - const_iterator begin() const { return const_iterator(snippets_.begin()); } |
| - const_iterator end() const { return const_iterator(snippets_.end()); } |
| + // Available snippets. |
| + const NTPSnippetStorage& snippets() const { return snippets_; } |
|
Marc Treib
2016/05/10 07:28:50
Not your doing, but the ordering is a bit weird he
mastiz
2016/05/10 07:35:16
Done, moved *after* FetchSnippetsFromHosts(), to s
|
| // Returns the maximum number of snippets that will be shown at once. |
| static int GetMaxSnippetCountForTesting(); |