| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ | 5 #ifndef COMPONENTS_NTP_TILES_POPULAR_SITES_H_ |
| 6 #define CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ | 6 #define COMPONENTS_NTP_TILES_POPULAR_SITES_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 17 #include "net/url_request/url_fetcher_delegate.h" | 17 #include "net/url_request/url_fetcher_delegate.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace user_prefs { | 24 namespace user_prefs { |
| 25 class PrefRegistrySyncable; | 25 class PrefRegistrySyncable; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace variations { | 28 namespace variations { |
| 29 class VariationsService; | 29 class VariationsService; |
| 30 } | 30 } |
| 31 | 31 |
| 32 class PrefService; | 32 class PrefService; |
| 33 class TemplateURLService; | 33 class TemplateURLService; |
| 34 | 34 |
| 35 // TODO(sfiera): move to chrome_popular_sites.h | |
| 36 class ChromePopularSites { | |
| 37 public: | |
| 38 static base::FilePath GetDirectory(); | |
| 39 | |
| 40 private: | |
| 41 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromePopularSites); | |
| 42 }; | |
| 43 | |
| 44 // Downloads and provides a list of suggested popular sites, for display on | 35 // Downloads and provides a list of suggested popular sites, for display on |
| 45 // the NTP when there are not enough personalized suggestions. Caches the | 36 // the NTP when there are not enough personalized suggestions. Caches the |
| 46 // downloaded file on disk to avoid re-downloading on every startup. | 37 // downloaded file on disk to avoid re-downloading on every startup. |
| 47 class PopularSites : public net::URLFetcherDelegate { | 38 class PopularSites : public net::URLFetcherDelegate { |
| 48 public: | 39 public: |
| 49 struct Site { | 40 struct Site { |
| 50 Site(const base::string16& title, | 41 Site(const base::string16& title, |
| 51 const GURL& url, | 42 const GURL& url, |
| 52 const GURL& favicon_url, | 43 const GURL& favicon_url, |
| 53 const GURL& large_icon_url, | 44 const GURL& large_icon_url, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const TemplateURLService* template_url_service_; | 141 const TemplateURLService* template_url_service_; |
| 151 net::URLRequestContextGetter* download_context_; | 142 net::URLRequestContextGetter* download_context_; |
| 152 | 143 |
| 153 scoped_refptr<base::TaskRunner> runner_; | 144 scoped_refptr<base::TaskRunner> runner_; |
| 154 | 145 |
| 155 base::WeakPtrFactory<PopularSites> weak_ptr_factory_; | 146 base::WeakPtrFactory<PopularSites> weak_ptr_factory_; |
| 156 | 147 |
| 157 DISALLOW_COPY_AND_ASSIGN(PopularSites); | 148 DISALLOW_COPY_AND_ASSIGN(PopularSites); |
| 158 }; | 149 }; |
| 159 | 150 |
| 160 #endif // CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ | 151 #endif // COMPONENTS_NTP_TILES_POPULAR_SITES_H_ |
| OLD | NEW |