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

Unified Diff: device/geolocation/mock_location_provider.cc

Issue 2161223003: Adds GeolocationFeature for Blimp Geolocation project. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@engine_feature_prep
Patch Set: More merging. 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
« no previous file with comments | « device/geolocation/mock_location_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/mock_location_provider.cc
diff --git a/device/geolocation/mock_location_provider.cc b/device/geolocation/mock_location_provider.cc
index 8e1f1e6bd89664aecb7edfa9af583dc7726b4b50..4497b88a2d99bb8c846c716d5387a8a81f25dea9 100644
--- a/device/geolocation/mock_location_provider.cc
+++ b/device/geolocation/mock_location_provider.cc
@@ -1,57 +1,13 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file implements a mock location provider and the factory functions for
-// various ways of creating it.
-
#include "device/geolocation/mock_location_provider.h"
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/compiler_specific.h"
-#include "base/location.h"
-#include "base/logging.h"
-#include "base/memory/weak_ptr.h"
-#include "base/threading/thread_task_runner_handle.h"
-
namespace device {
-MockLocationProvider::MockLocationProvider()
- : state_(STOPPED),
- is_permission_granted_(false),
- provider_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
+MockLocationProvider::MockLocationProvider() {}
MockLocationProvider::~MockLocationProvider() {}
-void MockLocationProvider::HandlePositionChanged(const Geoposition& position) {
- if (provider_task_runner_->BelongsToCurrentThread()) {
- // The location arbitrator unit tests rely on this method running
- // synchronously.
- position_ = position;
- NotifyCallback(position_);
- } else {
- provider_task_runner_->PostTask(
- FROM_HERE, base::Bind(&MockLocationProvider::HandlePositionChanged,
- base::Unretained(this), position));
- }
-}
-
-bool MockLocationProvider::StartProvider(bool high_accuracy) {
- state_ = high_accuracy ? HIGH_ACCURACY : LOW_ACCURACY;
- return true;
-}
-
-void MockLocationProvider::StopProvider() {
- state_ = STOPPED;
-}
-
-const Geoposition& MockLocationProvider::GetPosition() {
- return position_;
-}
-
-void MockLocationProvider::OnPermissionGranted() {
- is_permission_granted_ = true;
-}
-
} // namespace device
« no previous file with comments | « device/geolocation/mock_location_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698