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