| 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 CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ |
| 6 #define CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ | 6 #define CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 net::URLRequestContextGetter* download_context, | 79 net::URLRequestContextGetter* download_context, |
| 80 const base::FilePath& directory, | 80 const base::FilePath& directory, |
| 81 const std::string& variation_param_country, | 81 const std::string& variation_param_country, |
| 82 const std::string& variation_param_version, | 82 const std::string& variation_param_version, |
| 83 bool force_download, | 83 bool force_download, |
| 84 const FinishedCallback& callback); | 84 const FinishedCallback& callback); |
| 85 | 85 |
| 86 // This fetches the popular sites from a given url and is only used for | 86 // This fetches the popular sites from a given url and is only used for |
| 87 // debugging through the popular-sites-internals page. | 87 // debugging through the popular-sites-internals page. |
| 88 PopularSites(PrefService* prefs, | 88 PopularSites(PrefService* prefs, |
| 89 const TemplateURLService* template_url_service, | |
| 90 net::URLRequestContextGetter* download_context, | 89 net::URLRequestContextGetter* download_context, |
| 91 const base::FilePath& directory, | 90 const base::FilePath& directory, |
| 92 const GURL& url, | 91 const GURL& url, |
| 93 const FinishedCallback& callback); | 92 const FinishedCallback& callback); |
| 94 | 93 |
| 95 ~PopularSites() override; | 94 ~PopularSites() override; |
| 96 | 95 |
| 97 const std::vector<Site>& sites() const { return sites_; } | 96 const std::vector<Site>& sites() const { return sites_; } |
| 98 | 97 |
| 99 // The country/version of the file that was last downloaded. | 98 // The country/version of the file that was last downloaded. |
| 100 std::string GetCountry() const; | 99 std::string GetCountry() const; |
| 101 std::string GetVersion() const; | 100 std::string GetVersion() const; |
| 102 | 101 |
| 103 const base::FilePath& local_path() const { return local_path_; } | 102 const base::FilePath& local_path() const { return local_path_; } |
| 104 | 103 |
| 105 // Register preferences used by this class. | 104 // Register preferences used by this class. |
| 106 static void RegisterProfilePrefs( | 105 static void RegisterProfilePrefs( |
| 107 user_prefs::PrefRegistrySyncable* user_prefs); | 106 user_prefs::PrefRegistrySyncable* user_prefs); |
| 108 | 107 |
| 109 private: | 108 private: |
| 110 PopularSites(PrefService* prefs, | 109 PopularSites(PrefService* prefs, |
| 111 const TemplateURLService* template_url_service, | |
| 112 net::URLRequestContextGetter* download_context, | 110 net::URLRequestContextGetter* download_context, |
| 113 const base::FilePath& directory, | 111 const base::FilePath& directory, |
| 114 const std::string& country, | 112 const std::string& country, |
| 115 const std::string& version, | 113 const std::string& version, |
| 116 const GURL& override_url, | 114 const GURL& override_url, |
| 117 bool force_download, | 115 bool force_download, |
| 118 const FinishedCallback& callback); | 116 const FinishedCallback& callback); |
| 119 | 117 |
| 120 GURL GetPopularSitesURL() const; | 118 GURL GetPopularSitesURL() const; |
| 121 | 119 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 140 FinishedCallback callback_; | 138 FinishedCallback callback_; |
| 141 std::unique_ptr<net::URLFetcher> fetcher_; | 139 std::unique_ptr<net::URLFetcher> fetcher_; |
| 142 bool is_fallback_; | 140 bool is_fallback_; |
| 143 std::vector<Site> sites_; | 141 std::vector<Site> sites_; |
| 144 std::string pending_country_; | 142 std::string pending_country_; |
| 145 std::string pending_version_; | 143 std::string pending_version_; |
| 146 | 144 |
| 147 base::FilePath local_path_; | 145 base::FilePath local_path_; |
| 148 | 146 |
| 149 PrefService* prefs_; | 147 PrefService* prefs_; |
| 150 const TemplateURLService* template_url_service_; | |
| 151 net::URLRequestContextGetter* download_context_; | 148 net::URLRequestContextGetter* download_context_; |
| 152 | 149 |
| 153 scoped_refptr<base::TaskRunner> runner_; | 150 scoped_refptr<base::TaskRunner> runner_; |
| 154 | 151 |
| 155 base::WeakPtrFactory<PopularSites> weak_ptr_factory_; | 152 base::WeakPtrFactory<PopularSites> weak_ptr_factory_; |
| 156 | 153 |
| 157 DISALLOW_COPY_AND_ASSIGN(PopularSites); | 154 DISALLOW_COPY_AND_ASSIGN(PopularSites); |
| 158 }; | 155 }; |
| 159 | 156 |
| 160 #endif // CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ | 157 #endif // CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ |
| OLD | NEW |