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

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
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_;
« no previous file with comments | « no previous file | chrome/browser/android/ntp/popular_sites.cc » ('j') | chrome/browser/resources/popular_sites_internals.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698