| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // suggestions if appropriate, and saves the new suggestions. | 214 // suggestions if appropriate, and saves the new suggestions. |
| 215 void SaveNewSuggestions(SuggestionsVector personal_suggestions); | 215 void SaveNewSuggestions(SuggestionsVector personal_suggestions); |
| 216 | 216 |
| 217 // Workhorse for SaveNewSuggestions above. Implemented as a separate static | 217 // Workhorse for SaveNewSuggestions above. Implemented as a separate static |
| 218 // method for ease of testing. | 218 // method for ease of testing. |
| 219 static SuggestionsVector MergeSuggestions( | 219 static SuggestionsVector MergeSuggestions( |
| 220 SuggestionsVector personal_suggestions, | 220 SuggestionsVector personal_suggestions, |
| 221 SuggestionsVector whitelist_suggestions, | 221 SuggestionsVector whitelist_suggestions, |
| 222 SuggestionsVector popular_suggestions); | 222 SuggestionsVector popular_suggestions); |
| 223 | 223 |
| 224 void SaveCurrentSuggestionsToPrefs(); | |
| 225 | |
| 226 // Notifies the observer about the availability of suggestions. | 224 // Notifies the observer about the availability of suggestions. |
| 227 // Also records impressions UMA if not done already. | 225 // Also records impressions UMA if not done already. |
| 228 void NotifyMostVisitedURLsObserver(); | 226 void NotifyMostVisitedURLsObserver(); |
| 229 | 227 |
| 230 void OnPopularSitesAvailable(bool success); | 228 void OnPopularSitesAvailable(bool success); |
| 231 | 229 |
| 232 // Records thumbnail-related UMA histogram metrics. | 230 // Records thumbnail-related UMA histogram metrics. |
| 233 void RecordThumbnailUMAMetrics(); | 231 void RecordThumbnailUMAMetrics(); |
| 234 | 232 |
| 235 // Records UMA histogram metrics related to the number of impressions. | 233 // Records UMA histogram metrics related to the number of impressions. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 282 |
| 285 // For callbacks may be run after destruction. | 283 // For callbacks may be run after destruction. |
| 286 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 284 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 287 | 285 |
| 288 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 286 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 289 }; | 287 }; |
| 290 | 288 |
| 291 } // namespace ntp_tiles | 289 } // namespace ntp_tiles |
| 292 | 290 |
| 293 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 291 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| OLD | NEW |