| 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 10 matching lines...) Expand all Loading... |
| 21 #include "components/ntp_tiles/ntp_tile.h" | 21 #include "components/ntp_tiles/ntp_tile.h" |
| 22 #include "components/ntp_tiles/popular_sites.h" | 22 #include "components/ntp_tiles/popular_sites.h" |
| 23 #include "components/suggestions/proto/suggestions.pb.h" | 23 #include "components/suggestions/proto/suggestions.pb.h" |
| 24 #include "components/suggestions/suggestions_service.h" | 24 #include "components/suggestions/suggestions_service.h" |
| 25 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 26 | 26 |
| 27 namespace history { | 27 namespace history { |
| 28 class TopSites; | 28 class TopSites; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace user_prefs { | 31 class PrefRegistrySimple; |
| 32 class PrefRegistrySyncable; | 32 class PrefService; |
| 33 } | |
| 34 | 33 |
| 35 class PrefService; | 34 class PrefService; |
| 36 | 35 |
| 37 namespace ntp_tiles { | 36 namespace ntp_tiles { |
| 38 | 37 |
| 39 class IconCacher; | 38 class IconCacher; |
| 40 | 39 |
| 41 // Shim interface for SupervisedUserService. | 40 // Shim interface for SupervisedUserService. |
| 42 class MostVisitedSitesSupervisor { | 41 class MostVisitedSitesSupervisor { |
| 43 public: | 42 public: |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Requests an asynchronous refresh of the suggestions. Notifies the observer | 108 // Requests an asynchronous refresh of the suggestions. Notifies the observer |
| 110 // once the request completes. | 109 // once the request completes. |
| 111 void Refresh(); | 110 void Refresh(); |
| 112 | 111 |
| 113 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); | 112 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); |
| 114 void ClearBlacklistedUrls(); | 113 void ClearBlacklistedUrls(); |
| 115 | 114 |
| 116 // MostVisitedSitesSupervisor::Observer implementation. | 115 // MostVisitedSitesSupervisor::Observer implementation. |
| 117 void OnBlockedSitesChanged() override; | 116 void OnBlockedSitesChanged() override; |
| 118 | 117 |
| 119 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 118 static void RegisterProfilePrefs(PrefRegistrySimple* registry); |
| 120 | 119 |
| 121 // Workhorse for SaveNewTiles. Implemented as a separate static and public | 120 // Workhorse for SaveNewTiles. Implemented as a separate static and public |
| 122 // method for ease of testing. | 121 // method for ease of testing. |
| 123 static NTPTilesVector MergeTiles(NTPTilesVector personal_tiles, | 122 static NTPTilesVector MergeTiles(NTPTilesVector personal_tiles, |
| 124 NTPTilesVector whitelist_tiles, | 123 NTPTilesVector whitelist_tiles, |
| 125 NTPTilesVector popular_tiles); | 124 NTPTilesVector popular_tiles); |
| 126 | 125 |
| 127 private: | 126 private: |
| 128 void BuildCurrentTiles(); | 127 void BuildCurrentTiles(); |
| 129 | 128 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 194 |
| 196 // For callbacks may be run after destruction. | 195 // For callbacks may be run after destruction. |
| 197 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 196 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 198 | 197 |
| 199 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 198 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 200 }; | 199 }; |
| 201 | 200 |
| 202 } // namespace ntp_tiles | 201 } // namespace ntp_tiles |
| 203 | 202 |
| 204 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 203 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| OLD | NEW |