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

Unified Diff: device/geolocation/geolocation_provider.h

Issue 2192683003: Revert of Reland: Geolocation: move from content/browser to device/ (patchset #2 id:20001 of https:… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2810
Patch Set: Created 4 years, 5 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/geolocation_export.h ('k') | device/geolocation/geolocation_provider_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/geolocation_provider.h
diff --git a/device/geolocation/geolocation_provider.h b/device/geolocation/geolocation_provider.h
deleted file mode 100644
index 97b7a4cd71c5034de73f0e83f06c405887cece0f..0000000000000000000000000000000000000000
--- a/device/geolocation/geolocation_provider.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012 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.
-
-#ifndef DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_
-#define DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_
-
-#include <memory>
-
-#include "base/callback_list.h"
-#include "device/geolocation/geolocation_export.h"
-
-namespace device {
-class GeolocationDelegate;
-struct Geoposition;
-
-// This is the main API to the geolocation subsystem. The application will hold
-// a single instance of this class and can register multiple clients to be
-// notified of location changes:
-// * Callbacks are registered by AddLocationUpdateCallback() and will keep
-// receiving updates until the returned subscription object is destructed.
-// The application must instantiate the GeolocationProvider on the UI thread and
-// must communicate with it on the same thread.
-// The underlying location arbitrator will only be enabled whilst there is at
-// least one registered observer or pending callback (and only after
-// UserDidOptIntoLocationServices). The arbitrator and the location providers it
-// uses run on a separate Geolocation thread.
-class GeolocationProvider {
- public:
- DEVICE_GEOLOCATION_EXPORT static GeolocationProvider* GetInstance();
-
- // Optional: provide a Delegate to override typical services.
- DEVICE_GEOLOCATION_EXPORT static void SetGeolocationDelegate(
- GeolocationDelegate* delegate);
-
- typedef base::Callback<void(const Geoposition&)> LocationUpdateCallback;
- typedef base::CallbackList<void(const Geoposition&)>::Subscription
- Subscription;
-
- // |enable_high_accuracy| is used as a 'hint' for the provider preferences for
- // this particular observer, however the observer could receive updates for
- // best available locations from any active provider whilst it is registered.
- virtual std::unique_ptr<Subscription> AddLocationUpdateCallback(
- const LocationUpdateCallback& callback,
- bool enable_high_accuracy) = 0;
-
- // Calling this method indicates the user has opted into using location
- // services, including sending network requests to [Google servers to] resolve
- // the user's location. Use this method carefully, in line with the rules in
- // go/chrome-privacy-doc.
- virtual void UserDidOptIntoLocationServices() = 0;
-
- // Overrides the current location for testing.
- //
- // Overrides the location for automation/testing. Suppresses any further
- // updates from the actual providers and sends an update with the overridden
- // position to all registered clients.
- //
- // Do not use this function in unit tests. The function instantiates the
- // singleton geolocation stack in the background and manipulates it to report
- // a fake location. Neither step can be undone, breaking unit test isolation
- // (crbug.com/125931).
- virtual void OverrideLocationForTesting(const Geoposition& position) = 0;
-
- protected:
- virtual~GeolocationProvider() {}
-};
-
-} // namespace device
-
-#endif // DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_
« no previous file with comments | « device/geolocation/geolocation_export.h ('k') | device/geolocation/geolocation_provider_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698