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

Unified Diff: chrome/browser/android/offline_pages/background_loader_offliner.cc

Issue 2835193005: Offline Pages - Policy cleanup (Closed)
Patch Set: Fix typo Created 3 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/offline_pages/prerendering_offliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/background_loader_offliner.cc
diff --git a/chrome/browser/android/offline_pages/background_loader_offliner.cc b/chrome/browser/android/offline_pages/background_loader_offliner.cc
index 90fa4d1f5d3774c840beea9c48b3af108b8fb587..529c67ab51f38433ba213f038233d7db15fa9853 100644
--- a/chrome/browser/android/offline_pages/background_loader_offliner.cc
+++ b/chrome/browser/android/offline_pages/background_loader_offliner.cc
@@ -119,16 +119,17 @@ bool BackgroundLoaderOffliner::LoadAndSave(
const ProgressCallback& progress_callback) {
DCHECK(completion_callback);
DCHECK(progress_callback);
+ DCHECK(offline_page_model_);
if (pending_request_) {
DVLOG(1) << "Already have pending request";
return false;
}
- // Do not allow loading for custom tabs clients if 3rd party cookies blocked.
- // TODO(dewittj): Revise api to specify policy rather than hard code to
- // name_space.
- if (request.client_id().name_space == kCCTNamespace &&
+ ClientPolicyController* policy_controller =
+ offline_page_model_->GetPolicyController();
+ if (policy_controller->IsDisabledWhenPrefetchDisabled(
+ request.client_id().name_space) &&
(AreThirdPartyCookiesBlocked(browser_context_) ||
IsNetworkPredictionDisabled(browser_context_))) {
DVLOG(1) << "WARNING: Unable to load when 3rd party cookies blocked or "
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/prerendering_offliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698