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

Unified Diff: device/geolocation/fake_location_provider.cc

Issue 2298013002: Gets rid of LocationProviderBase. (Closed)
Patch Set: Typo. Created 4 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
« no previous file with comments | « device/geolocation/fake_location_provider.h ('k') | device/geolocation/location_provider_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..14bc4d0fb9cca5c5b3b1e4581949b46449d8fb0a 100644
--- a/device/geolocation/fake_location_provider.cc
+++ b/device/geolocation/fake_location_provider.cc
@@ -29,7 +29,8 @@ 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())
+ callback_.Run(this, position_);
} else {
provider_task_runner_->PostTask(
FROM_HERE, base::Bind(&FakeLocationProvider::HandlePositionChanged,
@@ -37,6 +38,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;
« no previous file with comments | « device/geolocation/fake_location_provider.h ('k') | device/geolocation/location_provider_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698