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

Unified Diff: device/geolocation/geolocation_provider_impl.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_provider.h ('k') | device/geolocation/geolocation_provider_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/geolocation_provider_impl.h
diff --git a/device/geolocation/geolocation_provider_impl.h b/device/geolocation/geolocation_provider_impl.h
deleted file mode 100644
index f21b9dcc5a783bb04f644cc4ee2158462b9e62bf..0000000000000000000000000000000000000000
--- a/device/geolocation/geolocation_provider_impl.h
+++ /dev/null
@@ -1,106 +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_IMPL_H_
-#define DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_
-
-#include <list>
-#include <memory>
-#include <vector>
-
-#include "base/callback_forward.h"
-#include "base/compiler_specific.h"
-#include "base/macros.h"
-#include "base/threading/thread.h"
-#include "device/geolocation/geolocation_export.h"
-#include "device/geolocation/geolocation_provider.h"
-#include "device/geolocation/geoposition.h"
-
-namespace base {
-template<typename Type> struct DefaultSingletonTraits;
-class SingleThreadTaskRunner;
-}
-
-namespace device {
-class LocationArbitrator;
-
-class DEVICE_GEOLOCATION_EXPORT GeolocationProviderImpl
- : public NON_EXPORTED_BASE(GeolocationProvider),
- public base::Thread {
- public:
- // GeolocationProvider implementation:
- std::unique_ptr<GeolocationProvider::Subscription> AddLocationUpdateCallback(
- const LocationUpdateCallback& callback,
- bool enable_high_accuracy) override;
- void UserDidOptIntoLocationServices() override;
- void OverrideLocationForTesting(const Geoposition& position) override;
-
- // Callback from the LocationArbitrator. Public for testing.
- void OnLocationUpdate(const Geoposition& position);
-
- // Gets a pointer to the singleton instance of the location relayer, which
- // is in turn bound to the browser's global context objects. This must only be
- // called on the UI thread so that the GeolocationProviderImpl is always
- // instantiated on the same thread. Ownership is NOT returned.
- static GeolocationProviderImpl* GetInstance();
-
- bool user_did_opt_into_location_services_for_testing() {
- return user_did_opt_into_location_services_;
- }
-
- protected:
- friend struct base::DefaultSingletonTraits<GeolocationProviderImpl>;
- GeolocationProviderImpl();
- ~GeolocationProviderImpl() override;
-
- // Useful for injecting mock geolocation arbitrator in tests.
- // TODO(mvanouwerkerk): Use something like SetArbitratorForTesting instead.
- virtual std::unique_ptr<LocationArbitrator> CreateArbitrator();
-
- private:
- bool OnGeolocationThread() const;
-
- // Start and stop providers as needed when clients are added or removed.
- void OnClientsChanged();
-
- // Stops the providers when there are no more registered clients. Note that
- // once the Geolocation thread is started, it will stay alive (but sitting
- // idle without any pending messages).
- void StopProviders();
-
- // Starts the geolocation providers or updates their options (delegates to
- // arbitrator).
- void StartProviders(bool enable_high_accuracy);
-
- // Updates the providers on the geolocation thread, which must be running.
- void InformProvidersPermissionGranted();
-
- // Notifies all registered clients that a position update is available.
- void NotifyClients(const Geoposition& position);
-
- // Thread
- void Init() override;
- void CleanUp() override;
-
- base::CallbackList<void(const Geoposition&)> high_accuracy_callbacks_;
- base::CallbackList<void(const Geoposition&)> low_accuracy_callbacks_;
-
- bool user_did_opt_into_location_services_;
- Geoposition position_;
-
- // True only in testing, where we want to use a custom position.
- bool ignore_location_updates_;
-
- // Only to be used on the geolocation thread.
- std::unique_ptr<LocationArbitrator> arbitrator_;
-
- // Used to PostTask()s from the geolocation thread to creation thread.
- const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(GeolocationProviderImpl);
-};
-
-} // namespace device
-
-#endif // DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_
« no previous file with comments | « device/geolocation/geolocation_provider.h ('k') | device/geolocation/geolocation_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698