Chromium Code Reviews| Index: chrome/browser/android/ntp/popular_sites.h |
| diff --git a/chrome/browser/android/ntp/popular_sites.h b/chrome/browser/android/ntp/popular_sites.h |
| index 486501aa85d0211e464f000ee9cb01aea76016c1..ab48fd6e45806e884bf39e7da7fa9d16799b0c0d 100644 |
| --- a/chrome/browser/android/ntp/popular_sites.h |
| +++ b/chrome/browser/android/ntp/popular_sites.h |
| @@ -5,6 +5,7 @@ |
| #ifndef CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ |
| #define CHROME_BROWSER_ANDROID_NTP_POPULAR_SITES_H_ |
| +#include <string> |
| #include <vector> |
| #include "base/callback.h" |
| @@ -13,6 +14,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/strings/string16.h" |
| +#include "chrome/browser/net/file_downloader.h" |
| #include "url/gurl.h" |
| namespace net { |
| @@ -23,7 +25,6 @@ namespace user_prefs { |
| class PrefRegistrySyncable; |
| } |
| -class FileDownloader; |
| class Profile; |
| // Downloads and provides a list of suggested popular sites, for display on |
| @@ -70,7 +71,11 @@ class PopularSites { |
| const std::vector<Site>& sites() const { return sites_; } |
| - const base::FilePath& local_path() const { return popular_sites_local_path_; } |
| + // The country/version of the file that was last downloaded. |
| + std::string country() const; |
|
Bernhard Bauer
2016/04/06 15:41:54
Nit: Make these GetCountry() and GetVersion(), as
Marc Treib
2016/04/06 16:37:10
Done. (I had to rename the global GetVersion (to G
|
| + std::string version() const; |
| + |
| + const base::FilePath& local_path() const { return local_path_; } |
| // Register preferences used by this class. |
| static void RegisterProfilePrefs( |
| @@ -78,7 +83,9 @@ class PopularSites { |
| private: |
| PopularSites(Profile* profile, |
| - const GURL& url, |
| + const std::string& country, |
| + const std::string& version, |
| + const GURL& override_url, |
| bool force_download, |
| const FinishedCallback& callback); |
| @@ -90,7 +97,7 @@ class PopularSites { |
| // If the download was not successful and it was not a fallback, attempt to |
| // download the fallback suggestions. |
| - void OnDownloadDone(bool success, bool is_fallback); |
| + void OnDownloadDone(bool is_fallback, FileDownloader::Result result); |
| void ParseSiteList(const base::FilePath& path); |
| void OnJsonParsed(scoped_ptr<std::vector<Site>> sites); |
| @@ -98,8 +105,10 @@ class PopularSites { |
| FinishedCallback callback_; |
| scoped_ptr<FileDownloader> downloader_; |
| std::vector<Site> sites_; |
| + std::string pending_country_; |
| + std::string pending_version_; |
| - base::FilePath popular_sites_local_path_; |
| + base::FilePath local_path_; |
| Profile* profile_; |