| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/scoped_observer.h" | 18 #include "base/scoped_observer.h" |
| 19 #include "components/history/core/browser/history_types.h" | 19 #include "components/history/core/browser/history_types.h" |
| 20 #include "components/history/core/browser/top_sites_observer.h" | 20 #include "components/history/core/browser/top_sites_observer.h" |
| 21 #include "components/ntp_tiles/popular_sites.h" | 21 #include "components/ntp_tiles/popular_sites.h" |
| 22 #include "components/suggestions/proto/suggestions.pb.h" | 22 #include "components/suggestions/proto/suggestions.pb.h" |
| 23 #include "components/suggestions/suggestions_service.h" | 23 #include "components/suggestions/suggestions_service.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 namespace gfx { | |
| 27 class Image; | |
| 28 } | |
| 29 | |
| 30 namespace history { | 26 namespace history { |
| 31 class TopSites; | 27 class TopSites; |
| 32 } | 28 } |
| 33 | 29 |
| 34 namespace suggestions { | 30 namespace suggestions { |
| 35 class SuggestionsService; | 31 class SuggestionsService; |
| 36 } | 32 } |
| 37 | 33 |
| 38 namespace user_prefs { | 34 namespace user_prefs { |
| 39 class PrefRegistrySyncable; | 35 class PrefRegistrySyncable; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 scoped_refptr<history::TopSites> top_sites, | 135 scoped_refptr<history::TopSites> top_sites, |
| 140 suggestions::SuggestionsService* suggestions, | 136 suggestions::SuggestionsService* suggestions, |
| 141 MostVisitedSitesSupervisor* supervisor); | 137 MostVisitedSitesSupervisor* supervisor); |
| 142 | 138 |
| 143 ~MostVisitedSites() override; | 139 ~MostVisitedSites() override; |
| 144 | 140 |
| 145 // Does not take ownership of |observer|, which must outlive this object and | 141 // Does not take ownership of |observer|, which must outlive this object and |
| 146 // must not be null. | 142 // must not be null. |
| 147 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); | 143 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); |
| 148 | 144 |
| 149 using ThumbnailCallback = base::Callback< | |
| 150 void(bool /* is_local_thumbnail */, const SkBitmap* /* bitmap */)>; | |
| 151 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); | 145 void AddOrRemoveBlacklistedUrl(const GURL& url, bool add_url); |
| 152 void RecordTileTypeMetrics(const std::vector<int>& tile_types); | 146 void RecordTileTypeMetrics(const std::vector<int>& tile_types); |
| 153 void RecordOpenedMostVisitedItem(int index, int tile_type); | 147 void RecordOpenedMostVisitedItem(int index, int tile_type); |
| 154 | 148 |
| 155 // MostVisitedSitesSupervisor::Observer implementation. | 149 // MostVisitedSitesSupervisor::Observer implementation. |
| 156 void OnBlockedSitesChanged() override; | 150 void OnBlockedSitesChanged() override; |
| 157 | 151 |
| 158 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 152 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 159 | 153 |
| 160 private: | 154 private: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 256 |
| 263 // For callbacks may be run after destruction. | 257 // For callbacks may be run after destruction. |
| 264 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 258 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 265 | 259 |
| 266 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 260 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 267 }; | 261 }; |
| 268 | 262 |
| 269 } // namespace ntp_tiles | 263 } // namespace ntp_tiles |
| 270 | 264 |
| 271 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 265 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| OLD | NEW |