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

Unified Diff: device/geolocation/fake_location_provider.cc

Issue 2298013002: Gets rid of LocationProviderBase. (Closed)
Patch Set: Created 4 years, 4 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: device/geolocation/fake_location_provider.cc
diff --git a/device/geolocation/fake_location_provider.cc b/device/geolocation/fake_location_provider.cc
index 18e25694bbc2652acee1c95db2e9fa5cae511967..94fbe0dbff0cb043da29d44c790567376957cc15 100644
--- a/device/geolocation/fake_location_provider.cc
+++ b/device/geolocation/fake_location_provider.cc
@@ -29,7 +29,9 @@ void FakeLocationProvider::HandlePositionChanged(const Geoposition& position) {
// The location arbitrator unit tests rely on this method running
// synchronously.
position_ = position;
- NotifyCallback(position_);
+ if (!callback_.is_null()) {
Michael van Ouwerkerk 2016/08/31 09:44:37 nit: no need for curly braces for this one-line bo
CJ 2016/08/31 17:22:11 Done.
+ callback_.Run(this, position_);
+ }
} else {
provider_task_runner_->PostTask(
FROM_HERE, base::Bind(&FakeLocationProvider::HandlePositionChanged,
@@ -37,6 +39,11 @@ void FakeLocationProvider::HandlePositionChanged(const Geoposition& position) {
}
}
+void FakeLocationProvider::SetUpdateCallback(
+ const LocationProviderUpdateCallback& callback) {
+ callback_ = callback;
+}
+
bool FakeLocationProvider::StartProvider(bool high_accuracy) {
state_ = high_accuracy ? HIGH_ACCURACY : LOW_ACCURACY;
return true;

Powered by Google App Engine
This is Rietveld 408576698