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

Side by Side Diff: components/ntp_tiles/most_visited_sites.h

Issue 2395483002: Allow top_sites to be null. (Closed)
Patch Set: Add comment/TODO. Created 4 years, 2 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
« no previous file with comments | « no previous file | components/ntp_tiles/most_visited_sites.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TILES_MOST_VISITED_SITES_H_ 5 #ifndef COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_
6 #define COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ 6 #define COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 public: 106 public:
107 virtual void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) = 0; 107 virtual void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) = 0;
108 virtual void OnPopularURLsAvailable(const PopularSitesVector& sites) {} 108 virtual void OnPopularURLsAvailable(const PopularSitesVector& sites) {}
109 109
110 protected: 110 protected:
111 virtual ~Observer() {} 111 virtual ~Observer() {}
112 }; 112 };
113 113
114 // Construct a MostVisitedSites instance. 114 // Construct a MostVisitedSites instance.
115 // 115 //
116 // |prefs|, |top_sites|, and |suggestions| are required and may not be null. 116 // |prefs| and |suggestions| are required and may not be null. |top_sites|,
117 // |popular_sites| and |supervisor| are optional and if null the associated 117 // |popular_sites|, and |supervisor| are optional and if null the associated
118 // features will be disabled. 118 // features will be disabled.
119 MostVisitedSites(PrefService* prefs, 119 MostVisitedSites(PrefService* prefs,
120 scoped_refptr<history::TopSites> top_sites, 120 scoped_refptr<history::TopSites> top_sites,
121 suggestions::SuggestionsService* suggestions, 121 suggestions::SuggestionsService* suggestions,
122 std::unique_ptr<PopularSites> popular_sites, 122 std::unique_ptr<PopularSites> popular_sites,
123 MostVisitedSitesSupervisor* supervisor); 123 MostVisitedSitesSupervisor* supervisor);
124 124
125 ~MostVisitedSites() override; 125 ~MostVisitedSites() override;
126 126
127 // Does not take ownership of |observer|, which must outlive this object and 127 // Does not take ownership of |observer|, which must outlive this object and
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 // For callbacks may be run after destruction. 232 // For callbacks may be run after destruction.
233 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; 233 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_;
234 234
235 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); 235 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites);
236 }; 236 };
237 237
238 } // namespace ntp_tiles 238 } // namespace ntp_tiles
239 239
240 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ 240 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_tiles/most_visited_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698