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..709722b93526cbfc35f72e4cbf5789dc4528585f 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,12 @@ 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 loaded. These only have |
| + // well-defined values after FinishedCallback has been called! |
|
Bernhard Bauer
2016/04/01 15:49:47
That also applies to sites(), right?
Marc Treib
2016/04/01 16:33:28
sites() will just be empty. These might actually h
|
| + const std::string& country() const { return country_; } |
| + const std::string& version() const { return version_; } |
| + |
| + const base::FilePath& local_path() const { return local_path_; } |
| // Register preferences used by this class. |
| static void RegisterProfilePrefs( |
| @@ -78,7 +84,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 +98,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 +106,10 @@ class PopularSites { |
| FinishedCallback callback_; |
| scoped_ptr<FileDownloader> downloader_; |
| std::vector<Site> sites_; |
| + std::string country_; |
| + std::string version_; |
| - base::FilePath popular_sites_local_path_; |
| + base::FilePath local_path_; |
| Profile* profile_; |