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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const TemplateURLService* template_url_service, | 154 const TemplateURLService* template_url_service, |
155 variations::VariationsService* variations_service, | 155 variations::VariationsService* variations_service, |
156 net::URLRequestContextGetter* download_context, | 156 net::URLRequestContextGetter* download_context, |
157 const base::FilePath& popular_sites_directory, | 157 const base::FilePath& popular_sites_directory, |
158 scoped_refptr<history::TopSites> top_sites, | 158 scoped_refptr<history::TopSites> top_sites, |
159 suggestions::SuggestionsService* suggestions, | 159 suggestions::SuggestionsService* suggestions, |
160 MostVisitedSitesSupervisor* supervisor); | 160 MostVisitedSitesSupervisor* supervisor); |
161 | 161 |
162 ~MostVisitedSites() override; | 162 ~MostVisitedSites() override; |
163 | 163 |
| 164 #if defined(OS_ANDROID) |
| 165 static bool Register(JNIEnv* env); |
| 166 #endif |
| 167 |
164 // Does not take ownership of |observer|, which must outlive this object and | 168 // Does not take ownership of |observer|, which must outlive this object and |
165 // must not be null. | 169 // must not be null. |
166 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); | 170 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); |
167 | 171 |
168 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); | 172 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); |
169 void RecordTileTypeMetrics(const std::vector<int>& tile_types, | 173 void RecordTileTypeMetrics(const std::vector<int>& tile_types, |
170 const std::vector<int>& sources); | 174 const std::vector<int>& sources); |
171 void RecordOpenedMostVisitedItem(int index, int tile_type, int source); | 175 void RecordOpenedMostVisitedItem(int index, int tile_type, int source); |
172 | 176 |
173 // MostVisitedSitesSupervisor::Observer implementation. | 177 // MostVisitedSitesSupervisor::Observer implementation. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 279 |
276 // For callbacks may be run after destruction. | 280 // For callbacks may be run after destruction. |
277 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 281 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
278 | 282 |
279 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 283 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
280 }; | 284 }; |
281 | 285 |
282 } // namespace ntp_tiles | 286 } // namespace ntp_tiles |
283 | 287 |
284 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 288 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
OLD | NEW |