OLD | NEW |
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 MostVisitedSites(scoped_refptr<base::SequencedWorkerPool> blocking_pool, | 152 MostVisitedSites(scoped_refptr<base::SequencedWorkerPool> blocking_pool, |
153 PrefService* prefs, | 153 PrefService* prefs, |
154 scoped_refptr<history::TopSites> top_sites, | 154 scoped_refptr<history::TopSites> top_sites, |
155 suggestions::SuggestionsService* suggestions, | 155 suggestions::SuggestionsService* suggestions, |
156 PopularSites* popular_sites, | 156 PopularSites* popular_sites, |
157 MostVisitedSitesSupervisor* supervisor); | 157 MostVisitedSitesSupervisor* supervisor); |
158 | 158 |
159 ~MostVisitedSites() override; | 159 ~MostVisitedSites() override; |
160 | 160 |
161 #if defined(OS_ANDROID) | |
162 static bool Register(JNIEnv* env); | |
163 #endif | |
164 | |
165 // Does not take ownership of |observer|, which must outlive this object and | 161 // Does not take ownership of |observer|, which must outlive this object and |
166 // must not be null. | 162 // must not be null. |
167 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); | 163 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); |
168 | 164 |
169 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); | 165 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); |
170 void RecordTileTypeMetrics(const std::vector<int>& tile_types, | 166 void RecordTileTypeMetrics(const std::vector<int>& tile_types, |
171 const std::vector<int>& sources); | 167 const std::vector<int>& sources); |
172 void RecordOpenedMostVisitedItem(int index, int tile_type, int source); | 168 void RecordOpenedMostVisitedItem(int index, int tile_type, int source); |
173 | 169 |
174 // MostVisitedSitesSupervisor::Observer implementation. | 170 // MostVisitedSitesSupervisor::Observer implementation. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 266 |
271 // For callbacks may be run after destruction. | 267 // For callbacks may be run after destruction. |
272 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 268 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
273 | 269 |
274 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 270 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
275 }; | 271 }; |
276 | 272 |
277 } // namespace ntp_tiles | 273 } // namespace ntp_tiles |
278 | 274 |
279 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 275 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
OLD | NEW |