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

Unified Diff: components/offline_pages/core/background/scheduler_stub.cc

Issue 2662103003: Always get device conditions from Java for every attempt. (Closed)
Patch Set: Created 3 years, 11 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 | « components/offline_pages/core/background/scheduler_stub.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/core/background/scheduler_stub.cc
diff --git a/components/offline_pages/core/background/scheduler_stub.cc b/components/offline_pages/core/background/scheduler_stub.cc
index 278536aa5a851f40ba5eeb3cf75576a946810a1c..f80c60c3eee0be29e4994ffe24094b9e3a577e49 100644
--- a/components/offline_pages/core/background/scheduler_stub.cc
+++ b/components/offline_pages/core/background/scheduler_stub.cc
@@ -4,31 +4,45 @@
#include "components/offline_pages/core/background/scheduler_stub.h"
+namespace {
+const int kBatteryPercentageHigh = 75;
+const bool kPowerRequired = true;
+} // namespace
+
namespace offline_pages {
SchedulerStub::SchedulerStub()
: schedule_called_(false),
backup_schedule_called_(false),
unschedule_called_(false),
+ get_current_device_conditions_called_(false),
schedule_delay_(0L),
- conditions_(false, 0, false) {}
+ device_conditions_(kPowerRequired,
+ kBatteryPercentageHigh,
+ net::NetworkChangeNotifier::CONNECTION_2G),
+ trigger_conditions_(false, 0, false) {}
SchedulerStub::~SchedulerStub() {}
void SchedulerStub::Schedule(const TriggerConditions& trigger_conditions) {
schedule_called_ = true;
- conditions_ = trigger_conditions;
+ trigger_conditions_ = trigger_conditions;
}
void SchedulerStub::BackupSchedule(const TriggerConditions& trigger_conditions,
long delay_in_seconds) {
backup_schedule_called_ = true;
schedule_delay_ = delay_in_seconds;
- conditions_ = trigger_conditions;
+ trigger_conditions_ = trigger_conditions;
}
void SchedulerStub::Unschedule() {
unschedule_called_ = true;
}
+const DeviceConditions& SchedulerStub::GetCurrentDeviceConditions() {
+ get_current_device_conditions_called_ = true;
+ return device_conditions_;
+}
+
} // namespace offline_pages
« no previous file with comments | « components/offline_pages/core/background/scheduler_stub.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698