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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.h

Issue 592423005: Supervised user blacklist: Add downloader class to download a blacklist if needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment Created 6 years, 3 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/supervised_user/supervised_user_service.h
diff --git a/chrome/browser/supervised_user/supervised_user_service.h b/chrome/browser/supervised_user/supervised_user_service.h
index 2c60d77e919a035a7d726384a27c3a9b0a0591aa..0f3a93461e39f2c7db845cf7aac7cc190d30512d 100644
--- a/chrome/browser/supervised_user/supervised_user_service.h
+++ b/chrome/browser/supervised_user/supervised_user_service.h
@@ -35,6 +35,7 @@ class Browser;
class GoogleServiceAuthError;
class PermissionRequestCreator;
class Profile;
+class SupervisedUserBlacklistDownloader;
class SupervisedUserRegistrationUtility;
class SupervisedUserServiceObserver;
class SupervisedUserSettingsService;
@@ -84,6 +85,9 @@ class SupervisedUserService : public KeyedService,
// Returns the path to a blacklist file to load, or an empty path to
// indicate "none".
virtual base::FilePath GetBlacklistPath() const = 0;
+ // Returns the URL from which to download a blacklist if no local one exists
+ // yet. The blacklist file will be stored at |GetBlacklistPath()|.
+ virtual GURL GetBlacklistURL() const = 0;
};
virtual ~SupervisedUserService();
@@ -281,9 +285,16 @@ class SupervisedUserService : public KeyedService,
void UpdateSiteLists();
+ // Asynchronously downloads a static blacklist file from |url|, stores it at
+ // |path|, loads it, and applies it to the URL filters. If |url| is not valid
+ // (e.g. empty), directly tries to load from |path|.
+ void LoadBlacklist(const base::FilePath& path, const GURL& url);
+
// Asynchronously loads a static blacklist from a binary file at |path| and
// applies it to the URL filters.
- void LoadBlacklist(const base::FilePath& path);
+ void LoadBlacklistFromFile(const base::FilePath& path);
+
+ void OnBlacklistDownloadDone(const base::FilePath& path, bool success);
// Updates the manual overrides for hosts in the URL filters when the
// corresponding preference is changed.
@@ -327,6 +338,7 @@ class SupervisedUserService : public KeyedService,
bool did_shutdown_;
URLFilterContext url_filter_context_;
+ scoped_ptr<SupervisedUserBlacklistDownloader> blacklist_downloader_;
// Used to create permission requests.
scoped_ptr<PermissionRequestCreator> permissions_creator_;

Powered by Google App Engine
This is Rietveld 408576698