| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 68   virtual std::vector<Whitelist> whitelists() = 0; | 68   virtual std::vector<Whitelist> whitelists() = 0; | 
| 69 | 69 | 
| 70   // If true, be conservative about suggesting sites from outside sources. | 70   // If true, be conservative about suggesting sites from outside sources. | 
| 71   virtual bool IsChildProfile() = 0; | 71   virtual bool IsChildProfile() = 0; | 
| 72 }; | 72 }; | 
| 73 | 73 | 
| 74 // Tracks the list of most visited sites and their thumbnails. | 74 // Tracks the list of most visited sites and their thumbnails. | 
| 75 class MostVisitedSites : public history::TopSitesObserver, | 75 class MostVisitedSites : public history::TopSitesObserver, | 
| 76                          public MostVisitedSitesSupervisor::Observer { | 76                          public MostVisitedSitesSupervisor::Observer { | 
| 77  public: | 77  public: | 
| 78   using PopularSitesVector = std::vector<PopularSites::Site>; |  | 
| 79 |  | 
| 80   // The observer to be notified when the list of most visited sites changes. | 78   // The observer to be notified when the list of most visited sites changes. | 
| 81   class Observer { | 79   class Observer { | 
| 82    public: | 80    public: | 
| 83     virtual void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) = 0; | 81     virtual void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) = 0; | 
| 84     virtual void OnIconMadeAvailable(const GURL& site_url) = 0; | 82     virtual void OnIconMadeAvailable(const GURL& site_url) = 0; | 
| 85 | 83 | 
| 86    protected: | 84    protected: | 
| 87     virtual ~Observer() {} | 85     virtual ~Observer() {} | 
| 88   }; | 86   }; | 
| 89 | 87 | 
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 197 | 195 | 
| 198   // For callbacks may be run after destruction. | 196   // For callbacks may be run after destruction. | 
| 199   base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 197   base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 
| 200 | 198 | 
| 201   DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 199   DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 
| 202 }; | 200 }; | 
| 203 | 201 | 
| 204 }  // namespace ntp_tiles | 202 }  // namespace ntp_tiles | 
| 205 | 203 | 
| 206 #endif  // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 204 #endif  // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 
| OLD | NEW | 
|---|