Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: chrome/browser/android/ntp/popular_sites.h

Issue 1851803002: [NTP Popular Sites] Store country/version in prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/android/ntp/popular_sites.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3735414451b50519774b659adc6b656af08bf7d5 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 GetCountry() const;
+ std::string GetVersion() const;
+
+ const base::FilePath& local_path() const { return local_path_; }
// Register preferences used by this class.
static void RegisterProfilePrefs(
@@ -78,10 +83,14 @@ 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);
+ GURL GetPopularSitesURL() const;
+
// Fetch the popular sites at the given URL. |force_download| should be true
// if any previously downloaded site list should be overwritten.
void FetchPopularSites(const GURL& url,
@@ -90,7 +99,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 +107,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_;
« no previous file with comments | « no previous file | chrome/browser/android/ntp/popular_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698