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

Side by Side Diff: content/browser/geolocation/location_arbitrator_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, 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ 5 #ifndef CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_
6 #define DEVICE_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ 6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/cancelable_callback.h" 12 #include "base/cancelable_callback.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "device/geolocation/access_token_store.h" 17 #include "content/browser/geolocation/location_arbitrator.h"
18 #include "device/geolocation/geolocation_export.h" 18 #include "content/common/content_export.h"
19 #include "device/geolocation/geolocation_provider.h" 19 #include "content/public/browser/access_token_store.h"
20 #include "device/geolocation/geoposition.h" 20 #include "content/public/browser/geolocation_provider.h"
21 #include "device/geolocation/location_arbitrator.h" 21 #include "content/public/browser/location_provider.h"
22 #include "device/geolocation/location_provider.h" 22 #include "content/public/common/geoposition.h"
23 #include "net/url_request/url_request_context_getter.h" 23 #include "net/url_request/url_request_context_getter.h"
24 24
25 namespace net { 25 namespace net {
26 class URLRequestContextGetter; 26 class URLRequestContextGetter;
27 } 27 }
28 28
29 namespace device { 29 namespace content {
30 class AccessTokenStore; 30 class AccessTokenStore;
31 class GeolocationDelegate; 31 class GeolocationDelegate;
32 class LocationProvider; 32 class LocationProvider;
33 33
34 // This class is responsible for handling updates from multiple underlying 34 // This class is responsible for handling updates from multiple underlying
35 // providers and resolving them to a single 'best' location fix at any given 35 // providers and resolving them to a single 'best' location fix at any given
36 // moment. 36 // moment.
37 class DEVICE_GEOLOCATION_EXPORT LocationArbitratorImpl 37 class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator {
38 : public LocationArbitrator {
39 public: 38 public:
40 // Number of milliseconds newer a location provider has to be that it's worth 39 // Number of milliseconds newer a location provider has to be that it's worth
41 // switching to this location provider on the basis of it being fresher 40 // switching to this location provider on the basis of it being fresher
42 // (regardles of relative accuracy). Public for tests. 41 // (regardles of relative accuracy). Public for tests.
43 static const int64_t kFixStaleTimeoutMilliseconds; 42 static const int64_t kFixStaleTimeoutMilliseconds;
44 43
45 typedef base::Callback<void(const Geoposition&)> LocationUpdateCallback; 44 typedef base::Callback<void(const Geoposition&)> LocationUpdateCallback;
46 45
47 LocationArbitratorImpl(const LocationUpdateCallback& callback, 46 LocationArbitratorImpl(const LocationUpdateCallback& callback,
48 GeolocationDelegate* delegate); 47 GeolocationDelegate* delegate);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Tracks whether providers should be running. 116 // Tracks whether providers should be running.
118 bool is_running_; 117 bool is_running_;
119 118
120 DISALLOW_COPY_AND_ASSIGN(LocationArbitratorImpl); 119 DISALLOW_COPY_AND_ASSIGN(LocationArbitratorImpl);
121 }; 120 };
122 121
123 // Factory functions for the various types of location provider to abstract 122 // Factory functions for the various types of location provider to abstract
124 // over the platform-dependent implementations. 123 // over the platform-dependent implementations.
125 std::unique_ptr<LocationProvider> NewSystemLocationProvider(); 124 std::unique_ptr<LocationProvider> NewSystemLocationProvider();
126 125
127 } // namespace device 126 } // namespace content
128 127
129 #endif // DEVICE_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ 128 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/geolocation/location_arbitrator.h ('k') | content/browser/geolocation/location_arbitrator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698