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

Unified Diff: device/geolocation/mock_location_provider.cc

Issue 2226143002: Gets rid of the LocationArbitrator interface, in preference for LocationProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses kmarshall's #41 comments 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/mock_location_provider.cc
diff --git a/device/geolocation/mock_location_provider.cc b/device/geolocation/mock_location_provider.cc
index 8190c5a2483530f7ba10bc79cdb679f60ee92d17..4a7714e98c4bf1f3fa17351f6f2a2c897f30d8c0 100644
--- a/device/geolocation/mock_location_provider.cc
+++ b/device/geolocation/mock_location_provider.cc
@@ -24,6 +24,10 @@ MockLocationProvider::MockLocationProvider()
MockLocationProvider::~MockLocationProvider() {}
+bool MockLocationProvider::IsProviderStarted() const {
+ return state_ != STOPPED;
+}
+
void MockLocationProvider::HandlePositionChanged(const Geoposition& position) {
if (provider_task_runner_->BelongsToCurrentThread()) {
// The location arbitrator unit tests rely on this method running
@@ -46,8 +50,8 @@ void MockLocationProvider::StopProvider() {
state_ = STOPPED;
}
-void MockLocationProvider::GetPosition(Geoposition* position) {
- *position = position_;
+const Geoposition& MockLocationProvider::GetPosition() {
+ return position_;
}
void MockLocationProvider::OnPermissionGranted() {

Powered by Google App Engine
This is Rietveld 408576698