| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 ~MostVisitedSites() override; | 166 ~MostVisitedSites() override; |
| 167 | 167 |
| 168 // 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 |
| 169 // must not be null. | 169 // must not be null. |
| 170 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); | 170 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); |
| 171 | 171 |
| 172 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); | 172 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); |
| 173 void RecordTileTypeMetrics(const std::vector<int>& tile_types, | 173 void RecordTileTypeMetrics(const std::vector<int>& tile_types, |
| 174 const std::vector<int>& sources); | 174 const std::vector<int>& sources); |
| 175 void RecordOpenedMostVisitedItem(int index, int tile_type); | 175 void RecordOpenedMostVisitedItem(int index, int tile_type, int source); |
| 176 | 176 |
| 177 // MostVisitedSitesSupervisor::Observer implementation. | 177 // MostVisitedSitesSupervisor::Observer implementation. |
| 178 void OnBlockedSitesChanged() override; | 178 void OnBlockedSitesChanged() override; |
| 179 | 179 |
| 180 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 180 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 181 | 181 |
| 182 private: | 182 private: |
| 183 friend class MostVisitedSitesTest; | 183 friend class MostVisitedSitesTest; |
| 184 | 184 |
| 185 void BuildCurrentSuggestions(); | 185 void BuildCurrentSuggestions(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 // For callbacks may be run after destruction. | 282 // For callbacks may be run after destruction. |
| 283 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 283 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 284 | 284 |
| 285 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 285 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 } // namespace ntp_tiles | 288 } // namespace ntp_tiles |
| 289 | 289 |
| 290 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 290 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| OLD | NEW |