| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 PopularSites* popular_sites, | 122 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 |
| 128 // must not be null. | 128 // must not be null. |
| 129 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); | 129 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); |
| 130 | 130 |
| 131 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); | 131 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); |
| 132 void RecordTileTypeMetrics(const std::vector<int>& tile_types, | 132 void RecordTileTypeMetrics(const std::vector<MostVisitedTileType>& tile_types, |
| 133 const std::vector<int>& sources); | 133 const std::vector<NTPTileSource>& sources); |
| 134 void RecordOpenedMostVisitedItem(int index, int tile_type, int source); | 134 void RecordOpenedMostVisitedItem(int index, |
| 135 MostVisitedTileType tile_type, |
| 136 NTPTileSource source); |
| 135 | 137 |
| 136 // MostVisitedSitesSupervisor::Observer implementation. | 138 // MostVisitedSitesSupervisor::Observer implementation. |
| 137 void OnBlockedSitesChanged() override; | 139 void OnBlockedSitesChanged() override; |
| 138 | 140 |
| 139 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 141 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 140 | 142 |
| 141 private: | 143 private: |
| 142 friend class MostVisitedSitesTest; | 144 friend class MostVisitedSitesTest; |
| 143 | 145 |
| 144 void BuildCurrentTiles(); | 146 void BuildCurrentTiles(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 231 |
| 230 // For callbacks may be run after destruction. | 232 // For callbacks may be run after destruction. |
| 231 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 233 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 232 | 234 |
| 233 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 235 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 234 }; | 236 }; |
| 235 | 237 |
| 236 } // namespace ntp_tiles | 238 } // namespace ntp_tiles |
| 237 | 239 |
| 238 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 240 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| OLD | NEW |