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

Unified Diff: components/offline_pages/background/offliner_policy.h

Issue 2177943005: Move user requested trigger conditions into policy object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | components/offline_pages/background/request_coordinator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/offliner_policy.h
diff --git a/components/offline_pages/background/offliner_policy.h b/components/offline_pages/background/offliner_policy.h
index ee2cc0db615b05a614ff0ce23379ac3e1fa54196..6e1aed34426e30fbdccbc71a2ecfaba86c4e8b6a 100644
--- a/components/offline_pages/background/offliner_policy.h
+++ b/components/offline_pages/background/offliner_policy.h
@@ -38,6 +38,21 @@ class OfflinerPolicy {
// The max number of times we will retry a request.
int GetMaxRetries() { return kMaxRetries; }
+ bool PowerRequiredForUserRequestedPage() { return false; }
fgorski 2016/07/26 16:42:14 all these should be const methods top to bottom (t
Pete Williamson 2016/07/26 19:39:34 Done (I changed the ones not already changed in th
+
+ bool PowerRequiredForNonUserRequestedPage() { return true; }
+
+ bool UnmeteredNetworkRequiredForUserRequestedPage() { return false; }
+
+ bool UnmeteredNetworkRequiredForNonUserRequestedPage() { return true; }
+
+ int BatteryPercentageRequiredForUserRequestedPage() { return 50; }
+
+ // This is so low because we require the device to be plugged in and charging.
+ // If we decide to allow non-user requested pages when not plugged in, we
+ // should raise this somewhat higher.
+ int BatteryPercentageRequiredForNonUserRequestedPage() { return 25; }
+
// How many seconds to keep trying new pages for, before we give up, and
// return to the scheduler.
int GetBackgroundProcessingTimeBudgetSeconds() {
« no previous file with comments | « no previous file | components/offline_pages/background/request_coordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698