| OLD | NEW |
| 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 CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ |
| 6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 10 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 11 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 12 #include "content/browser/geolocation/location_arbitrator.h" | 15 #include "content/browser/geolocation/location_arbitrator.h" |
| 13 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 14 #include "content/public/browser/access_token_store.h" | 17 #include "content/public/browser/access_token_store.h" |
| 15 #include "content/public/browser/location_provider.h" | 18 #include "content/public/browser/location_provider.h" |
| 16 #include "content/public/common/geoposition.h" | 19 #include "content/public/common/geoposition.h" |
| 17 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
| 18 | 21 |
| 19 namespace net { | 22 namespace net { |
| 20 class URLRequestContextGetter; | 23 class URLRequestContextGetter; |
| 21 } | 24 } |
| 22 | 25 |
| 23 namespace content { | 26 namespace content { |
| 24 class AccessTokenStore; | 27 class AccessTokenStore; |
| 25 class LocationProvider; | 28 class LocationProvider; |
| 26 | 29 |
| 27 // This class is responsible for handling updates from multiple underlying | 30 // This class is responsible for handling updates from multiple underlying |
| 28 // providers and resolving them to a single 'best' location fix at any given | 31 // providers and resolving them to a single 'best' location fix at any given |
| 29 // moment. | 32 // moment. |
| 30 class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator { | 33 class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator { |
| 31 public: | 34 public: |
| 32 // Number of milliseconds newer a location provider has to be that it's worth | 35 // Number of milliseconds newer a location provider has to be that it's worth |
| 33 // switching to this location provider on the basis of it being fresher | 36 // switching to this location provider on the basis of it being fresher |
| 34 // (regardles of relative accuracy). Public for tests. | 37 // (regardles of relative accuracy). Public for tests. |
| 35 static const int64 kFixStaleTimeoutMilliseconds; | 38 static const int64_t kFixStaleTimeoutMilliseconds; |
| 36 | 39 |
| 37 typedef base::Callback<void(const Geoposition&)> LocationUpdateCallback; | 40 typedef base::Callback<void(const Geoposition&)> LocationUpdateCallback; |
| 38 | 41 |
| 39 explicit LocationArbitratorImpl(const LocationUpdateCallback& callback); | 42 explicit LocationArbitratorImpl(const LocationUpdateCallback& callback); |
| 40 ~LocationArbitratorImpl() override; | 43 ~LocationArbitratorImpl() override; |
| 41 | 44 |
| 42 static GURL DefaultNetworkProviderURL(); | 45 static GURL DefaultNetworkProviderURL(); |
| 43 | 46 |
| 44 // LocationArbitrator | 47 // LocationArbitrator |
| 45 void StartProviders(bool use_high_accuracy) override; | 48 void StartProviders(bool use_high_accuracy) override; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 DISALLOW_COPY_AND_ASSIGN(LocationArbitratorImpl); | 101 DISALLOW_COPY_AND_ASSIGN(LocationArbitratorImpl); |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 // Factory functions for the various types of location provider to abstract | 104 // Factory functions for the various types of location provider to abstract |
| 102 // over the platform-dependent implementations. | 105 // over the platform-dependent implementations. |
| 103 LocationProvider* NewSystemLocationProvider(); | 106 LocationProvider* NewSystemLocationProvider(); |
| 104 | 107 |
| 105 } // namespace content | 108 } // namespace content |
| 106 | 109 |
| 107 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ | 110 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ |
| OLD | NEW |